]> Cypherpunks.ru repositories - gostls13.git/commit
crypto/tls: add GetClientCertificate callback
authorAdam Langley <agl@golang.org>
Wed, 26 Oct 2016 17:05:03 +0000 (10:05 -0700)
committerAdam Langley <agl@golang.org>
Thu, 27 Oct 2016 17:20:07 +0000 (17:20 +0000)
commit81038d2e2b588f9df45d20a2ca0be446b0e421b2
tree380716894756019904c8506f007514ea7eb00aba
parent6c242c52d355772f66466505dd7555d4601f1c5a
crypto/tls: add GetClientCertificate callback

Currently, the selection of a client certificate done internally based
on the limitations given by the server's request and the certifcates in
the Config. This means that it's not possible for an application to
control that selection based on details of the request.

This change adds a callback, GetClientCertificate, that is called by a
Client during the handshake and which allows applications to select the
best certificate at that time.

(Based on https://golang.org/cl/25570/ by Bernd Fix.)

Fixes #16626.

Change-Id: Ia4cea03235d2aa3c9fd49c99c227593c8e86ddd9
Reviewed-on: https://go-review.googlesource.com/32115
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/crypto/tls/common.go
src/crypto/tls/handshake_client.go
src/crypto/tls/handshake_client_test.go
src/crypto/tls/tls_test.go