TypeError: ssl() argument 1 must be _socket.socket, not _socketobject

Huzaifa Tapal huzaifa at hostway.com
Tue Apr 26 00:34:04 EDT 2005


I am getting this error from python 2.3.5 when making secure socket 
connections from my mod_python based application.  It is very odd 
because we cannot replicate this in the development environment, only in 
production on a cluster of 2 debian boxes with Apache2 MPM Worker w/ Mod 
Python 3.13.

Does anybody have any ideas as to what could be causing this error?

Here is the full traceback:

    Traceback:    File 
"/home/orderform/www/cgi-bin/OrderForm_bundle/hwmodules/register/dp_registrar/DPRegistrar.py", 
line 95, in _
_execCmd
        con.endheaders()
       File "/usr/lib/python2.3/httplib.py", line 715, in endheaders
        self._send_output()
       File "/usr/lib/python2.3/httplib.py", line 600, in _send_output
        self.send(msg)
       File "/usr/lib/python2.3/httplib.py", line 567, in send
        self.connect()
       File "/usr/lib/python2.3/httplib.py", line 988, in connect
        ssl = socket.ssl(sock, self.key_file, self.cert_file)
       File "/usr/lib/python2.3/socket.py", line 73, in ssl
        return _realssl(sock, keyfile, certfile)
    TypeError: ssl() argument 1 must be _socket.socket, not _socketobject

The thing is that if we restart the web server, it works fine for about 
20 minutes after which we start getting these errors.

Any help would be appreciated.

Hozi




More information about the Python-list mailing list