Reputation: 1705
I realised that my problem with wrapping sockets in ssl
, when the socket is built from a fd
is related to a socket._socketobject
being converted (after rebuilding it from fd
) into a socket._socket
.
Is there any way to turn the socket._socket back into a _socketobject
?
Thanks
Upvotes: 1
Views: 1477
Reputation: 1705
The only solution that actually works was found in a lonely post here: http://www.velocityreviews.com/forums/t557014-socket-vs-_socketobject.html
To get a socket._socketobject
from a socket._socket
you need to do:
newSockObj = socket.socket(_sock=sock)
Ugly, but it works, as that post said...
Upvotes: 4