[issue32359] Add getters for all SSLContext internal configuration

2018-02-26 Thread Christian Heimes
Christian Heimes added the comment: Let's see how much we can fix in 3.8. Maybe I'll find enough free time to implement PEP 543 for Python 3.8. -- assignee: christian.heimes -> stage: -> needs patch type: -> enhancement versions: +Python 3.8 ___

[issue32359] Add getters for all SSLContext internal configuration

2017-12-18 Thread Nathaniel Smith
Nathaniel Smith added the comment: Yeah, I'm not entirely sure whether fixing this is actually doable or worthwhile, but figured I should at least make an issue to discuss :-). The problem is, in the motivating use case of wanting to be able to reliably convert an SSLContext into some other r

[issue32359] Add getters for all SSLContext internal configuration

2017-12-18 Thread Christian Heimes
Christian Heimes added the comment: For certs and keys I have some plans. You might not be able to get hold of the actual private key bits, but it is always possible to get the public bits and key information. The trust store information is pretty much opaque and often loaded by demand. http

[issue32359] Add getters for all SSLContext internal configuration

2017-12-18 Thread Nathaniel Smith
Nathaniel Smith added the comment: I think we already hold onto the ALPN list internally. A possibly stickier issue is retrieving certificates, keys, trust db configuration. -- ___ Python tracker __

[issue32359] Add getters for all SSLContext internal configuration

2017-12-18 Thread Christian Heimes
Christian Heimes added the comment: I opened an issue about missing getters for ALPN protos in OpenSSL 1.1: https://github.com/openssl/openssl/issues/4952 -- ___ Python tracker __

[issue32359] Add getters for all SSLContext internal configuration

2017-12-18 Thread Christian Heimes
Christian Heimes added the comment: Let's see what's missing: * alpn_protocols -- OpenSSL doesn't have SSL_CTX_get_alpn_protos(), so we'd have to keep the list around ourselves. * npn_protocols -- deprecated, I'd rather add a getter * servername_callback -- simply expose the PyObject* from our

[issue32359] Add getters for all SSLContext internal configuration

2017-12-18 Thread Christian Heimes
Christian Heimes added the comment: I'm considering to add CAPI capsule to the _ssl module. It would allow third parties to get hold of the internal SSL* and SSL_CTX* pointers. -- ___ Python tracker

[issue32359] Add getters for all SSLContext internal configuration

2017-12-18 Thread Nathaniel Smith
New submission from Nathaniel Smith : Suppose you're writing a library that allows users to make or accept SSL/TLS connections. You use the 'ssl' module, because that's convenient. You need to let your users configure your SSL/TLS connections, and there really isn't any generic abstract way to