The _ssl.sslwrap function appears to check to see if the sock passed in is a subclass of _socket.socket. I am passing in a class that implements the interface of _socket.socket.
It gets mad because my socket isn't a subclass. Is this something I should fix on my side, or is this something that I should ask about from the python-dev guys?
Here is the code from ssl.SSLSocket.init that is giving me grief:
self._sslobj = _ssl.sslwrap(self._sock, server_side,
keyfile, certfile,
cert_reqs, ssl_version, ca_certs,
ciphers)
In my case, self._sock is an instance of my custom socket class.
UPDATE:
I am going to look into how twisted does some of this stuff. My fake socket is getting too complicated. However, I am still curious why the _ssl module is enforcing the socket type the way it is.