1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/pkg/tlsconfig/tlsconfig_clone_go16.go
Stephen J Day 9d7be9df8f tlsconfig: move Clone into proper package
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-09-09 12:05:17 -07:00

31 lines
1.1 KiB
Go

// +build go1.6,!go1.7
package tlsconfig
import "crypto/tls"
// Clone returns a clone of tls.Config. This function is provided for
// compatibility for go1.6 that doesn't include this method in stdlib.
func Clone(c *tls.Config) *tls.Config {
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,
}
}