Warn about failed handshakes earlier and fallback to default suite

This commit is contained in:
Frank Denis 2018-04-11 11:42:30 +02:00
parent 6b3212d3d7
commit 3dbdf54c1f
2 changed files with 5 additions and 3 deletions

View File

@ -270,9 +270,6 @@ func (serversInfo *ServersInfo) fetchDoHServerInfo(proxy *Proxy, name string, st
if _, _, err := proxy.xTransport.DoHQuery(useGet, url, body, proxy.timeout); err != nil {
useGet = true
if _, _, err := proxy.xTransport.DoHQuery(useGet, url, body, proxy.timeout); err != nil {
if proxy.xTransport.tlsCipherSuite != nil && strings.Contains(err.Error(), "handshake failure") {
dlog.Warnf("TLS handshake failure - Try changing or deleting the tls_cipher_suite value in the configuration file")
}
return ServerInfo{}, err
}
dlog.Debugf("Server [%s] doesn't appear to support POST; falling back to GET requests", name)

View File

@ -235,6 +235,11 @@ func (xTransport *XTransport) Fetch(method string, url *url.URL, accept string,
}
if err != nil {
dlog.Debugf("[%s]: [%s]", req.URL, err)
if xTransport.tlsCipherSuite != nil && strings.Contains(err.Error(), "handshake failure") {
dlog.Warnf("TLS handshake failure - Try changing or deleting the tls_cipher_suite value in the configuration file")
xTransport.tlsCipherSuite = nil
xTransport.rebuildTransport()
}
}
return resp, rtt, err
}