@@ -77,7 +77,6 @@ type XTransport struct {
7777 http3 bool
7878 http3Probe bool
7979 tlsDisableSessionTickets bool
80- tlsCipherSuite []uint16
8180 proxyDialer * netproxy.Dialer
8281 httpProxyFunction func (* http.Request ) (* url.URL , error )
8382 tlsClientCreds DOHClientCreds
@@ -100,7 +99,6 @@ func NewXTransport() *XTransport {
10099 useIPv6 : false ,
101100 http3Probe : false ,
102101 tlsDisableSessionTickets : false ,
103- tlsCipherSuite : nil ,
104102 keyLogWriter : nil ,
105103 }
106104 return & xTransport
@@ -327,40 +325,8 @@ func (xTransport *XTransport) rebuildTransport() {
327325 tlsClientConfig .Certificates = []tls.Certificate {cert }
328326 }
329327
330- overrideCipherSuite := len (xTransport .tlsCipherSuite ) > 0
331- if xTransport .tlsDisableSessionTickets || overrideCipherSuite {
332- tlsClientConfig .SessionTicketsDisabled = xTransport .tlsDisableSessionTickets
333- if ! xTransport .tlsDisableSessionTickets {
334- tlsClientConfig .ClientSessionCache = tls .NewLRUClientSessionCache (10 )
335- }
336- if overrideCipherSuite {
337- tlsClientConfig .PreferServerCipherSuites = false
338- tlsClientConfig .CipherSuites = xTransport .tlsCipherSuite
339-
340- // Go doesn't allow changing the cipher suite with TLS 1.3
341- // So, check if the requested set of ciphers matches the TLS 1.3 suite.
342- // If it doesn't, downgrade to TLS 1.2
343- compatibleSuitesCount := 0
344- for _ , suite := range tls .CipherSuites () {
345- if suite .Insecure {
346- continue
347- }
348- for _ , supportedVersion := range suite .SupportedVersions {
349- if supportedVersion == tls .VersionTLS12 {
350- for _ , expectedSuiteID := range xTransport .tlsCipherSuite {
351- if expectedSuiteID == suite .ID {
352- compatibleSuitesCount += 1
353- break
354- }
355- }
356- }
357- }
358- }
359- if compatibleSuitesCount != len (tls .CipherSuites ()) {
360- dlog .Notice ("Explicit cipher suite configured - downgrading to TLS 1.2" )
361- tlsClientConfig .MaxVersion = tls .VersionTLS12
362- }
363- }
328+ if xTransport .tlsDisableSessionTickets {
329+ tlsClientConfig .SessionTicketsDisabled = true
364330 }
365331 transport .TLSClientConfig = & tlsClientConfig
366332 if http2Transport , _ := http2 .ConfigureTransports (transport ); http2Transport != nil {
@@ -761,13 +727,6 @@ func (xTransport *XTransport) Fetch(
761727 }
762728 if err != nil {
763729 dlog .Debugf ("[%s]: [%s]" , req .URL , err )
764- if xTransport .tlsCipherSuite != nil && strings .Contains (err .Error (), "handshake failure" ) {
765- dlog .Warnf (
766- "TLS handshake failure - Try changing or deleting the tls_cipher_suite value in the configuration file" ,
767- )
768- xTransport .tlsCipherSuite = nil
769- xTransport .rebuildTransport ()
770- }
771730 return nil , statusCode , nil , rtt , err
772731 }
773732 if xTransport .h3Transport != nil && ! hasAltSupport {
0 commit comments