1

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

1 Answer 1

4

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...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.