Message309842
API example:
>>> import ssl
>>> chain = ssl.Certificate.chain_from_file("Lib/test/ssl_cert.pem")
>>> cas = ssl.Certificate.bundle_from_file("Lib/test/pycacert.pem")
>>> pkey = ssl.PrivateKey.from_file("Lib/test/ssl_key.passwd.pem")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ssl.SSLError: [PEM: BAD_PASSWORD_READ] bad password read (_ssl.c:58)
>>> pkey = ssl.PrivateKey.from_file("Lib/test/ssl_key.passwd.pem", password="somepass")
>>> chain
(<_ssl.Certificate '/C=XY/L=Castle Anthrax/O=Python Software Foundation/CN=localhost'>,)
>>> cas
[<_ssl.Certificate '/C=XY/O=Python Software Foundation CA/CN=our-ca-server'>]
>>> ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
>>> ctx.load_cert_chain(chain, pkey)
>>> ctx.load_verify_locations(cadata=cas) |
|
Date |
User |
Action |
Args |
2018-01-12 09:27:21 | christian.heimes | set | recipients:
+ christian.heimes, pitrou, cvrebert, maker, underrun |
2018-01-12 09:27:21 | christian.heimes | set | messageid: <1515749241.38.0.467229070634.issue18369@psf.upfronthosting.co.za> |
2018-01-12 09:27:21 | christian.heimes | link | issue18369 messages |
2018-01-12 09:27:21 | christian.heimes | create | |
|