github.com/ezoic/ws@v1.0.4-0.20220713205711-5c1d69e074c5/dialer_tls_go17.go (about)

     1  // +build !go1.8
     2  
     3  package ws
     4  
     5  import "crypto/tls"
     6  
     7  func tlsCloneConfig(c *tls.Config) *tls.Config {
     8  	// NOTE: we copying SessionTicketsDisabled and SessionTicketKey here
     9  	// without calling inner c.initOnceServer somehow because we only could get
    10  	// here from the ws.Dialer code, which is obviously a client and makes
    11  	// tls.Client() when it gets new net.Conn.
    12  	return &tls.Config{
    13  		Rand:                        c.Rand,
    14  		Time:                        c.Time,
    15  		Certificates:                c.Certificates,
    16  		NameToCertificate:           c.NameToCertificate,
    17  		GetCertificate:              c.GetCertificate,
    18  		RootCAs:                     c.RootCAs,
    19  		NextProtos:                  c.NextProtos,
    20  		ServerName:                  c.ServerName,
    21  		ClientAuth:                  c.ClientAuth,
    22  		ClientCAs:                   c.ClientCAs,
    23  		InsecureSkipVerify:          c.InsecureSkipVerify,
    24  		CipherSuites:                c.CipherSuites,
    25  		PreferServerCipherSuites:    c.PreferServerCipherSuites,
    26  		SessionTicketsDisabled:      c.SessionTicketsDisabled,
    27  		SessionTicketKey:            c.SessionTicketKey,
    28  		ClientSessionCache:          c.ClientSessionCache,
    29  		MinVersion:                  c.MinVersion,
    30  		MaxVersion:                  c.MaxVersion,
    31  		CurvePreferences:            c.CurvePreferences,
    32  		DynamicRecordSizingDisabled: c.DynamicRecordSizingDisabled,
    33  		Renegotiation:               c.Renegotiation,
    34  	}
    35  }