@@ -246,6 +246,8 @@ type ConnectionState struct {
246
246
// On the client side, it can't be empty. On the server side, it can be
247
247
// empty if Config.ClientAuth is not RequireAnyClientCert or
248
248
// RequireAndVerifyClientCert.
249
+ //
250
+ // PeerCertificates and its contents should not be modified.
249
251
PeerCertificates []* x509.Certificate
250
252
251
253
// VerifiedChains is a list of one or more chains where the first element is
@@ -255,6 +257,8 @@ type ConnectionState struct {
255
257
// On the client side, it's set if Config.InsecureSkipVerify is false. On
256
258
// the server side, it's set if Config.ClientAuth is VerifyClientCertIfGiven
257
259
// (and the peer provided a certificate) or RequireAndVerifyClientCert.
260
+ //
261
+ // VerifiedChains and its contents should not be modified.
258
262
VerifiedChains [][]* x509.Certificate
259
263
260
264
// SignedCertificateTimestamps is a list of SCTs provided by the peer
@@ -554,6 +558,8 @@ type Config struct {
554
558
// If GetCertificate is nil or returns nil, then the certificate is
555
559
// retrieved from NameToCertificate. If NameToCertificate is nil, the
556
560
// best element of Certificates will be used.
561
+ //
562
+ // Once a Certificate is returned it should not be modified.
557
563
GetCertificate func (* ClientHelloInfo ) (* Certificate , error )
558
564
559
565
// GetClientCertificate, if not nil, is called when a server requests a
@@ -569,6 +575,8 @@ type Config struct {
569
575
//
570
576
// GetClientCertificate may be called multiple times for the same
571
577
// connection if renegotiation occurs or if TLS 1.3 is in use.
578
+ //
579
+ // Once a Certificate is returned it should not be modified.
572
580
GetClientCertificate func (* CertificateRequestInfo ) (* Certificate , error )
573
581
574
582
// GetConfigForClient, if not nil, is called after a ClientHello is
@@ -597,6 +605,8 @@ type Config struct {
597
605
// setting InsecureSkipVerify, or (for a server) when ClientAuth is
598
606
// RequestClientCert or RequireAnyClientCert, then this callback will
599
607
// be considered but the verifiedChains argument will always be nil.
608
+ //
609
+ // verifiedChains and its contents should not be modified.
600
610
VerifyPeerCertificate func (rawCerts [][]byte , verifiedChains [][]* x509.Certificate ) error
601
611
602
612
// VerifyConnection, if not nil, is called after normal certificate
0 commit comments