fix conversion of qtls.ClientHelloInfo in GetConfigForClient

This commit is contained in:
Marten Seemann
2020-04-08 15:56:30 +07:00
parent 799d80197f
commit 66d50b4289
3 changed files with 16 additions and 2 deletions

View File

@@ -62,7 +62,11 @@ func tlsConfigToQtlsConfig(
var getConfigForClient func(ch *qtls.ClientHelloInfo) (*qtls.Config, error)
if c.GetConfigForClient != nil {
getConfigForClient = func(ch *qtls.ClientHelloInfo) (*qtls.Config, error) {
tlsConf, err := c.GetConfigForClient((*tls.ClientHelloInfo)(unsafe.Pointer(ch)))
var chi *tls.ClientHelloInfo
if ch != nil {
chi = toTLSClientHelloInfo(ch)
}
tlsConf, err := c.GetConfigForClient(chi)
if err != nil {
return nil, err
}