|
@@ -242,35 +242,6 @@ func (info TLSInfo) ClientConfig() (*tls.Config, error) {
|
|
|
return cfg, nil
|
|
return cfg, nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// ShallowCopyTLSConfig copies *tls.Config. This is only
|
|
|
|
|
-// work-around for go-vet tests, which complains
|
|
|
|
|
-//
|
|
|
|
|
-// assignment copies lock value to p: crypto/tls.Config contains sync.Once contains sync.Mutex
|
|
|
|
|
-//
|
|
|
|
|
-// Keep up-to-date with 'go/src/crypto/tls/common.go'
|
|
|
|
|
-func ShallowCopyTLSConfig(cfg *tls.Config) *tls.Config {
|
|
|
|
|
- ncfg := tls.Config{
|
|
|
|
|
- Time: cfg.Time,
|
|
|
|
|
- Certificates: cfg.Certificates,
|
|
|
|
|
- NameToCertificate: cfg.NameToCertificate,
|
|
|
|
|
- GetCertificate: cfg.GetCertificate,
|
|
|
|
|
- RootCAs: cfg.RootCAs,
|
|
|
|
|
- NextProtos: cfg.NextProtos,
|
|
|
|
|
- ServerName: cfg.ServerName,
|
|
|
|
|
- ClientAuth: cfg.ClientAuth,
|
|
|
|
|
- ClientCAs: cfg.ClientCAs,
|
|
|
|
|
- InsecureSkipVerify: cfg.InsecureSkipVerify,
|
|
|
|
|
- CipherSuites: cfg.CipherSuites,
|
|
|
|
|
- PreferServerCipherSuites: cfg.PreferServerCipherSuites,
|
|
|
|
|
- SessionTicketKey: cfg.SessionTicketKey,
|
|
|
|
|
- ClientSessionCache: cfg.ClientSessionCache,
|
|
|
|
|
- MinVersion: cfg.MinVersion,
|
|
|
|
|
- MaxVersion: cfg.MaxVersion,
|
|
|
|
|
- CurvePreferences: cfg.CurvePreferences,
|
|
|
|
|
- }
|
|
|
|
|
- return &ncfg
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
// IsClosedConnError returns true if the error is from closing listener, cmux.
|
|
// IsClosedConnError returns true if the error is from closing listener, cmux.
|
|
|
// copied from golang.org/x/net/http2/http2.go
|
|
// copied from golang.org/x/net/http2/http2.go
|
|
|
func IsClosedConnError(err error) bool {
|
|
func IsClosedConnError(err error) bool {
|