2016-09-08 00:38:55 -04:00
|
|
|
// +build go1.6,!go1.7
|
|
|
|
|
2016-09-08 23:21:27 -04:00
|
|
|
package tlsconfig
|
2016-09-08 00:38:55 -04:00
|
|
|
|
|
|
|
import "crypto/tls"
|
|
|
|
|
2016-09-08 23:21:27 -04:00
|
|
|
// Clone returns a clone of tls.Config. This function is provided for
|
2016-09-08 00:38:55 -04:00
|
|
|
// compatibility for go1.6 that doesn't include this method in stdlib.
|
2016-09-08 23:21:27 -04:00
|
|
|
func Clone(c *tls.Config) *tls.Config {
|
2016-09-08 00:38:55 -04:00
|
|
|
return &tls.Config{
|
|
|
|
Rand: c.Rand,
|
|
|
|
Time: c.Time,
|
|
|
|
Certificates: c.Certificates,
|
|
|
|
NameToCertificate: c.NameToCertificate,
|
|
|
|
GetCertificate: c.GetCertificate,
|
|
|
|
RootCAs: c.RootCAs,
|
|
|
|
NextProtos: c.NextProtos,
|
|
|
|
ServerName: c.ServerName,
|
|
|
|
ClientAuth: c.ClientAuth,
|
|
|
|
ClientCAs: c.ClientCAs,
|
|
|
|
InsecureSkipVerify: c.InsecureSkipVerify,
|
|
|
|
CipherSuites: c.CipherSuites,
|
|
|
|
PreferServerCipherSuites: c.PreferServerCipherSuites,
|
|
|
|
SessionTicketsDisabled: c.SessionTicketsDisabled,
|
|
|
|
SessionTicketKey: c.SessionTicketKey,
|
|
|
|
ClientSessionCache: c.ClientSessionCache,
|
|
|
|
MinVersion: c.MinVersion,
|
|
|
|
MaxVersion: c.MaxVersion,
|
|
|
|
CurvePreferences: c.CurvePreferences,
|
|
|
|
}
|
|
|
|
}
|