You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Use hlfhr.Newsrv:=hlfhr.New(&http.Server{
TLSConfig: &tls.Config{
GetCertificate: func(chi*tls.ClientHelloInfo) (*tls.Certificate, error) {
// Write something...
},
},
})
// Then just use it like [http.Server]l, err:=net.Listen("tcp", addr)
iferr!=nil {
returnerr
}
deferl.Close()
l=tls.NewListener(l, config)
srv.Serve(l)
✅ Please use ServeTLS:
// Use hlfhr.Newsrv:=hlfhr.New(&http.Server{
TLSConfig: &tls.Config{
GetCertificate: func(chi*tls.ClientHelloInfo) (*tls.Certificate, error) {
// Write something...
},
},
})
// Then just use it like [http.Server]l, err:=net.Listen("tcp", ":5678")
iferr!=nil {
returnerr
}
deferl.Close()
srv.ServeTLS("", "")
✅ or use ListenAndServeTLS
// Use hlfhr.Newsrv:=hlfhr.New(&http.Server{
Addr: ":5678",
TLSConfig: &tls.Config{
GetCertificate: func(chi*tls.ClientHelloInfo) (*tls.Certificate, error) {
// Write something...
},
},
})
// Then just use it like [http.Server]srv.ListenAndServeTLS("", "")
The text was updated successfully, but these errors were encountered:
❌ Don't use
Serve
like this:✅ Please use
ServeTLS
:✅ or use
ListenAndServeTLS
The text was updated successfully, but these errors were encountered: