[issue27629] Cannot create ssl.SSLSocket without existing socket

2017-09-07 Thread Christian Heimes
Christian Heimes added the comment: I have created #27629 to allow customization of SSLObject and SSLSocket. I'm closing this as "won't fix" because I rather want people to move away from ssl.wrap_socket() and manual instantiation of SSLSocket. -- resolution: -> wont fix stage: patch

[issue27629] Cannot create ssl.SSLSocket without existing socket

2017-09-07 Thread Christian Heimes
Christian Heimes added the comment: How about I make the actual SSLSocket and SSLObject class customizable so you can override what is returned by wrap_socket() and wrap_bio()? class MySSLSocket(ssl.SSLSocket): pass ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) ctx.sslsocket_class =

[issue27629] Cannot create ssl.SSLSocket without existing socket

2016-12-06 Thread nemunaire
Changes by nemunaire : Removed file: http://bugs.python.org/file43927/fix_sslsocket_init_without_socket_3_3-3_6.patch ___ Python tracker ___

[issue27629] Cannot create ssl.SSLSocket without existing socket

2016-12-06 Thread nemunaire
nemunaire added the comment: The documentation already recommends to use SSLContext.wrap_socket(), but it didn't cover all use cases. Eg. I use multiple inheritance to handle both socket and SSLSocket inside a factory pattern, in order to override some methods defined in both classes. If I

[issue27629] Cannot create ssl.SSLSocket without existing socket

2016-09-15 Thread Christian Heimes
Changes by Christian Heimes : -- assignee: -> christian.heimes components: +SSL ___ Python tracker ___

[issue27629] Cannot create ssl.SSLSocket without existing socket

2016-09-10 Thread Christian Heimes
Christian Heimes added the comment: I'm considering to not fix this bug and rather remove the dead code. This feature was never documented and has been broken since 3.3, maybe earlier. It's also hard to use it correctly because you need to pass the correct socket family and type. For 3.6 I'm

[issue27629] Cannot create ssl.SSLSocket without existing socket

2016-09-07 Thread Christian Heimes
Christian Heimes added the comment: The patch is incomplete. Please also check that type == SOCK_STREAM. The code can be simplified with a bitmask test: if sock is not None: type = sock.type if type & socket.SOCK_STREAM != socket.SOCK_STREAM: raise NotImplementedError --

[issue27629] Cannot create ssl.SSLSocket without existing socket

2016-07-28 Thread nemunaire
Changes by nemunaire : Removed file: http://bugs.python.org/file43900/fix_sslsocket_init_without_socket_3.3-3_6.patch ___ Python tracker ___

[issue27629] Cannot create ssl.SSLSocket without existing socket

2016-07-28 Thread nemunaire
nemunaire added the comment: Here is a new patch with tests on constructor. The patch on the feature is quite different: instead of testing for None socket, I choose to delay the != SOCK_STREAM check in the later condition, when we know we treat a socket. Tests include different constructor

[issue27629] Cannot create ssl.SSLSocket without existing socket

2016-07-27 Thread STINNER Victor
STINNER Victor added the comment: The change introducing the != SOCK_STREAM check (change a00842b783cf) was made in 2013. It looks like the case was not tested since at least 3 years... > This will need a test in Lib/test/test_ssl.py to check for this particular > case. Yes, this new test is

[issue27629] Cannot create ssl.SSLSocket without existing socket

2016-07-26 Thread Emanuel Barry
Emanuel Barry added the comment: Thank you for the report and the patch! :) This will need a test in Lib/test/test_ssl.py to check for this particular case. I've removed 3.3 and 3.4 from the Versions field, since these versions no longer get regular bugfixes (only security bugfixes may go in

[issue27629] Cannot create ssl.SSLSocket without existing socket

2016-07-26 Thread nemunaire
Changes by nemunaire : -- title: Cannot create raw ssl.SSLSocket -> Cannot create ssl.SSLSocket without existing socket ___ Python tracker