'module' object has no attribute 'ssl'

N

Niurka Perez

Hi,

I have Red Hat Linux 3.2.3-54 and Python 2.4.3 (the
original version downloaded from python.org) and I'm
using httplib to make a request to an external server,
this is the code I'm using:

import httplib
https = httplib.HTTPSConnection('216.220.59.211',
7989)
https.debuglevel = 1
body = buildXML(data)
try:
https.request('POST', '/Messenger/XMLMessenger',
body)
response = https.getresponse()
response = response.read()
https.close()
except:
response = None
import traceback
traceback.print_exc()
return response


And I get the following error:

Traceback (most recent call last):
File "testPayment.py", line 14, in preAuthPayment
https.request('POST', '/Messenger/XMLMessenger',
body)
File "/usr/local/lib/python2.4/httplib.py", line
804, in request
self._send_request(method, url, body, headers)
File "/usr/local/lib/python2.4/httplib.py", line
827, in _send_request
self.endheaders()
File "/usr/local/lib/python2.4/httplib.py", line
798, in endheaders
self._send_output()
File "/usr/local/lib/python2.4/httplib.py", line
679, in _send_output
self.send(msg)
File "/usr/local/lib/python2.4/httplib.py", line
646, in send
self.connect ()
File "/usr/local/lib/python2.4/httplib.py", line
1073, in connect
ssl = socket.ssl(sock, self.key_file,
self.cert_file)
AttributeError: 'module' object has no attribute 'ssl'

Anybody has an idea of what migth be happening?

Thank in advance.
Best Regards,

Niurka


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
 
D

Daniel Dittmar

Niurka said:
ssl = socket.ssl(sock, self.key_file,
self.cert_file)
AttributeError: 'module' object has no attribute 'ssl'

The socket module failed to import the _ssl module. And the ssl function
gets only defined if _ssl could be imported.

You probably haven't installed the OpenSSL-dev rpm. When the Python
configure couldn't find the SSL header files, it struck _ssl from the
list of compilable modules.

Daniel
 

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,968
Messages
2,570,152
Members
46,698
Latest member
LydiaHalle

Latest Threads

Top