diff --git a/handshake_server.go b/handshake_server.go index fd26c4f..03d0553 100644 --- a/handshake_server.go +++ b/handshake_server.go @@ -374,7 +374,8 @@ func (hs *serverHandshakeState) pickCipherSuite() error { hs.suite = selectCipherSuite(preferenceList, hs.clientHello.cipherSuites, hs.cipherSuiteOk) if hs.suite == nil { c.sendAlert(alertHandshakeFailure) - return errors.New("tls: no cipher suite supported by both client and server") + return fmt.Errorf("tls: no cipher suite supported by both client and server; client offered: %x", + hs.clientHello.cipherSuites) } c.cipherSuite = hs.suite.id diff --git a/handshake_server_tls13.go b/handshake_server_tls13.go index 119c699..2242e5c 100644 --- a/handshake_server_tls13.go +++ b/handshake_server_tls13.go @@ -18,6 +18,7 @@ import ( "crypto/x509" "encoding/binary" "errors" + "fmt" "hash" "io" "math/big" @@ -243,7 +244,8 @@ func (hs *serverHandshakeStateTLS13) processClientHello() error { } if hs.suite == nil { c.sendAlert(alertHandshakeFailure) - return errors.New("tls: no cipher suite supported by both client and server") + return fmt.Errorf("tls: no cipher suite supported by both client and server; client offered: %x", + hs.clientHello.cipherSuites) } c.cipherSuite = hs.suite.id hs.hello.cipherSuite = hs.suite.id