utils_go17.go 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Go MySQL Driver - A MySQL-Driver for Go's database/sql package
  2. //
  3. // Copyright 2017 The Go-MySQL-Driver Authors. All rights reserved.
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public
  6. // License, v. 2.0. If a copy of the MPL was not distributed with this file,
  7. // You can obtain one at http://mozilla.org/MPL/2.0/.
  8. // +build go1.7
  9. // +build !go1.8
  10. package mysql
  11. import "crypto/tls"
  12. func cloneTLSConfig(c *tls.Config) *tls.Config {
  13. return &tls.Config{
  14. Rand: c.Rand,
  15. Time: c.Time,
  16. Certificates: c.Certificates,
  17. NameToCertificate: c.NameToCertificate,
  18. GetCertificate: c.GetCertificate,
  19. RootCAs: c.RootCAs,
  20. NextProtos: c.NextProtos,
  21. ServerName: c.ServerName,
  22. ClientAuth: c.ClientAuth,
  23. ClientCAs: c.ClientCAs,
  24. InsecureSkipVerify: c.InsecureSkipVerify,
  25. CipherSuites: c.CipherSuites,
  26. PreferServerCipherSuites: c.PreferServerCipherSuites,
  27. SessionTicketsDisabled: c.SessionTicketsDisabled,
  28. SessionTicketKey: c.SessionTicketKey,
  29. ClientSessionCache: c.ClientSessionCache,
  30. MinVersion: c.MinVersion,
  31. MaxVersion: c.MaxVersion,
  32. CurvePreferences: c.CurvePreferences,
  33. DynamicRecordSizingDisabled: c.DynamicRecordSizingDisabled,
  34. Renegotiation: c.Renegotiation,
  35. }
  36. }