]> Cypherpunks repositories - gostls13.git/commit
crypto/tls: add ExampleConfig_VerifyPeerCertificate
authorFilippo Valsorda <filippo@golang.org>
Thu, 5 Sep 2019 18:23:08 +0000 (14:23 -0400)
committerFilippo Valsorda <filippo@golang.org>
Sat, 9 Nov 2019 20:08:06 +0000 (20:08 +0000)
commit29cfb4d3c3a97b6f426d1b899234da905be699aa
treecfb53911ff0e4a5382ea431bf1682c86bf525a03
parent7148478f1b433caa11c8827657ee1bc61f0b1c5d
crypto/tls: add ExampleConfig_VerifyPeerCertificate

Setting InsecureSkipVerify and VerifyPeerCertificate is the recommended
way to customize and override certificate validation.

However, there is boilerplate involved and it usually requires first
reimplementing the default validation strategy to then customize it.
Provide an example that does the same thing as the default as a starting
point.

Examples of where we directed users to do something similar are in
issues #35467, #31791, #28754, #21971, and #24151.

Fixes #31792

Change-Id: Id033e9fa3cac9dff1f7be05c72dfb34b4f973fd4
Reviewed-on: https://go-review.googlesource.com/c/go/+/193620
Reviewed-by: Adam Langley <agl@golang.org>
src/crypto/tls/example_test.go