1 // Copyright 2013 The Gorilla WebSocket Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
11 // cloneTLSConfig clones all public fields except the fields
12 // SessionTicketsDisabled and SessionTicketKey. This avoids copying the
13 // sync.Mutex in the sync.Once and makes it safe to call cloneTLSConfig on a
14 // config in active use.
15 func cloneTLSConfig(cfg *tls.Config) *tls.Config {
22 Certificates: cfg.Certificates,
23 NameToCertificate: cfg.NameToCertificate,
24 GetCertificate: cfg.GetCertificate,
26 NextProtos: cfg.NextProtos,
27 ServerName: cfg.ServerName,
28 ClientAuth: cfg.ClientAuth,
29 ClientCAs: cfg.ClientCAs,
30 InsecureSkipVerify: cfg.InsecureSkipVerify,
31 CipherSuites: cfg.CipherSuites,
32 PreferServerCipherSuites: cfg.PreferServerCipherSuites,
33 ClientSessionCache: cfg.ClientSessionCache,
34 MinVersion: cfg.MinVersion,
35 MaxVersion: cfg.MaxVersion,
36 CurvePreferences: cfg.CurvePreferences,