Christian Heimes <li...@cheimes.de> added the comment: 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) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue18369> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com