tris: drop QuietError

This commit is contained in:
Filippo Valsorda 2016-11-30 03:08:13 +00:00 committed by Peter Wu
parent 2b667f2952
commit 5c4af70647
2 changed files with 1 additions and 16 deletions

13
13.go
View File

@ -532,23 +532,10 @@ func (hs *serverHandshakeState) sendSessionTicket13() error {
return nil
}
// QuietError is an error wrapper that prevents the verbose handshake log
// dump on errors. Exposed for use by GetCertificate.
type QuietError struct {
Err error
}
func (e QuietError) Error() string {
return e.Err.Error() + " [quiet]"
}
func (hs *serverHandshakeState) traceErr(err error) {
if err == nil {
return
}
if _, ok := err.(QuietError); ok {
return
}
if os.Getenv("TLSDEBUG") == "error" {
if hs != nil && hs.clientHello != nil {
os.Stderr.WriteString(hex.Dump(hs.clientHello.marshal()))

View File

@ -282,9 +282,7 @@ Curves:
hs.cert, err = c.config.getCertificate(hs.clientHelloInfo())
if err != nil {
if _, ok := err.(QuietError); ok {
c.out.traceErr, c.in.traceErr = nil, nil
}
c.out.traceErr, c.in.traceErr = nil, nil // disable tracing
c.sendAlert(alertInternalError)
return false, err
}