github.com/getong/docker@v1.13.1/pkg/tlsconfig/tlsconfig_clone_go17.go (about)

     1  // +build go1.7,!go1.8
     2  
     3  package tlsconfig
     4  
     5  import "crypto/tls"
     6  
     7  // Clone returns a clone of tls.Config. This function is provided for
     8  // compatibility for go1.7 that doesn't include this method in stdlib.
     9  func Clone(c *tls.Config) *tls.Config {
    10  	return &tls.Config{
    11  		Rand:                        c.Rand,
    12  		Time:                        c.Time,
    13  		Certificates:                c.Certificates,
    14  		NameToCertificate:           c.NameToCertificate,
    15  		GetCertificate:              c.GetCertificate,
    16  		RootCAs:                     c.RootCAs,
    17  		NextProtos:                  c.NextProtos,
    18  		ServerName:                  c.ServerName,
    19  		ClientAuth:                  c.ClientAuth,
    20  		ClientCAs:                   c.ClientCAs,
    21  		InsecureSkipVerify:          c.InsecureSkipVerify,
    22  		CipherSuites:                c.CipherSuites,
    23  		PreferServerCipherSuites:    c.PreferServerCipherSuites,
    24  		SessionTicketsDisabled:      c.SessionTicketsDisabled,
    25  		SessionTicketKey:            c.SessionTicketKey,
    26  		ClientSessionCache:          c.ClientSessionCache,
    27  		MinVersion:                  c.MinVersion,
    28  		MaxVersion:                  c.MaxVersion,
    29  		CurvePreferences:            c.CurvePreferences,
    30  		DynamicRecordSizingDisabled: c.DynamicRecordSizingDisabled,
    31  		Renegotiation:               c.Renegotiation,
    32  	}
    33  }