Python SSL Socket issue

L

lauras

Hello,

We are having an issue with Python SSL sockets using Apache and mod_python.

When we try to get an SSL connection using the following code:

con = httplib.HTTPSConnection( self.HOST, self.PORT )
#con.set_debuglevel(10)
con.putrequest( "POST", "" )
con.putheader( "Content-Type", "text/xml" )
con.putheader( "content-length", int(len(cmd)) )
con.endheaders()
con.send( cmd )

We get the following error:

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


Has anyone encountered this before or has any suggestions?

Thanks,
Laura
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,108
Latest member
AlbertEste
Top