Merge pull request #2925 from mhils/clientcert-from-sni

Use sni to select clientcerts
This commit is contained in:
Aldo Cortesi 2018-02-26 11:35:35 +13:00 committed by GitHub
commit 494390bf07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -286,7 +286,8 @@ class ServerConnection(tcp.TCPClient, stateobject.StateObject):
else:
path = os.path.join(
client_certs,
self.address[0].encode("idna").decode()) + ".pem"
(sni or self.address[0].encode("idna").decode()) + ".pem"
)
if os.path.exists(path):
client_cert = path