|
| 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 | + |
| 9 | +// +build go1.7 |
| 10 | +// +build !go1.8 |
| 11 | + |
| 12 | +package mysql |
| 13 | + |
| 14 | +import "crypto/tls" |
| 15 | + |
| 16 | +func cloneTLSConfig(c *tls.Config) *tls.Config { |
| 17 | + return &tls.Config{ |
| 18 | + Rand: c.Rand, |
| 19 | + Time: c.Time, |
| 20 | + Certificates: c.Certificates, |
| 21 | + NameToCertificate: c.NameToCertificate, |
| 22 | + GetCertificate: c.GetCertificate, |
| 23 | + RootCAs: c.RootCAs, |
| 24 | + NextProtos: c.NextProtos, |
| 25 | + ServerName: c.ServerName, |
| 26 | + ClientAuth: c.ClientAuth, |
| 27 | + ClientCAs: c.ClientCAs, |
| 28 | + InsecureSkipVerify: c.InsecureSkipVerify, |
| 29 | + CipherSuites: c.CipherSuites, |
| 30 | + PreferServerCipherSuites: c.PreferServerCipherSuites, |
| 31 | + SessionTicketsDisabled: c.SessionTicketsDisabled, |
| 32 | + SessionTicketKey: c.SessionTicketKey, |
| 33 | + ClientSessionCache: c.ClientSessionCache, |
| 34 | + MinVersion: c.MinVersion, |
| 35 | + MaxVersion: c.MaxVersion, |
| 36 | + CurvePreferences: c.CurvePreferences, |
| 37 | + DynamicRecordSizingDisabled: c.DynamicRecordSizingDisabled, |
| 38 | + Renegotiation: c.Renegotiation, |
| 39 | + } |
| 40 | +} |
0 commit comments