Fix errNoCertificates

This commit is contained in:
hmol233 2021-05-10 00:11:45 +08:00
parent 53b99efe78
commit 1f92b948c0
No known key found for this signature in database
GPG key ID: D617A9DAB0C992D5
4 changed files with 14 additions and 2 deletions

View file

@ -235,7 +235,7 @@ func getNewGetCertificateFunc(certs []*tls.Certificate, rejectUnknownSNI bool) f
} }
} }
if rejectUnknownSNI { if rejectUnknownSNI {
return nil, newError("reject unknown sni") return nil, errNoCertificates
} }
return certs[0], nil return certs[0], nil
} }

View file

@ -0,0 +1,6 @@
package tls
import _ "unsafe"
//go:linkname errNoCertificates crypto/tls.errNoCertificates
var errNoCertificates error

View file

@ -236,7 +236,7 @@ func getNewGetCertificateFunc(certs []*xtls.Certificate, rejectUnknownSNI bool)
} }
} }
if rejectUnknownSNI { if rejectUnknownSNI {
return nil, newError("reject unknown sni") return nil, errNoCertificates
} }
return certs[0], nil return certs[0], nil
} }

View file

@ -0,0 +1,6 @@
package xtls
import _ "unsafe"
//go:linkname errNoCertificates crypto/tls.errNoCertificates
var errNoCertificates error