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