Adding support for TLS authentication#1469
Conversation
daf134c to
8008e7a
Compare
|
I'm trying to verify this, but as soon as I add ssl_context={
'keyfile': 'localhost-key.pem',
'certfile': 'localhost.pem',
'ca_certs': '/home/david/.local/share/mkcert/rootCA.pem',
'cert_reqs': ssl.CERT_REQUIRED,
} |
|
Must have been my computer, I tried on another and it's working as expected. |
8008e7a to
320abb6
Compare
|
While from cryptography import x509
from cryptography.hazmat.backends import default_backend
x509.load_pem_x509_certificate(cert.encode('ascii'), default_backend())Also rolling back the ability to pass a dict to context = ssl.SSLContext()
context.load_cert_chain("localhost.pem", "localhost-key.pem")
context.load_verify_locations("/home/david/.local/share/mkcert/rootCA.pem")
context.verify_mode = ssl.CERT_REQUIRED |
Continuation of PR #1188.
With this change added, one can use a dict with extra information to be added to socket creation on
load_ssl_context.Adding a more complex set of parameters to
ssl_context, when using Flask, for example, will be possible through a new valid instance of ssl context, such as:If possible - and valid, returned values from
SSLSocket.getpeercertwill be stored intoenviron['SSL_CLIENT_CERT'].