473,385 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

'module' object has no attribute 'ssl'

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
Jun 21 '06 #1
1 7214
Niurka Perez wrote:
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
Jun 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Peter Åstrand | last post by:
There's a new PEP available: PEP 324: popen5 - New POSIX process module A copy is included below. Comments are appreciated. ---- PEP: 324 Title: popen5 - New POSIX process module
0
by: Robert Brewer | last post by:
I finally cleaned up the code I've been using for a while now to grab objects out of modules via dotted-package names (all this work to avoid using exec! Sheesh!). Feel free to use it, abuse it, or...
18
by: Steven Bethard | last post by:
In the "empty classes as c structs?" thread, we've been talking in some detail about my proposed "generic objects" PEP. Based on a number of suggestions, I'm thinking more and more that instead of...
4
by: Edvard Majakari | last post by:
Greetings, fellow Pythonistas! I'm about to create three modules. As an avid TDD fan I'd like to create typical 'use-cases' for each of these modules. One of them is rather large, and I wondered...
30
by: Franck PEREZ | last post by:
Hello, I'm developing a small XML marshaller and I'm facing an annoying issue. Here's some sample code: ########### My test application ############ class Foo(object): #The class I'd like to...
0
by: Carl Waldbieser | last post by:
I am trying to understand how the SSL object in the socket module is supposed to be used. From looking at the documentation, I can work out that you need to pass a socket into the ssl() function,...
5
by: johnny | last post by:
I am getting the following errors: File "H:\xampp\xampp\xampp\python\lib\httplib.py", line 679, in _send_output self.send(msg) File "H:\xampp\xampp\xampp\python\lib\httplib.py", line 646, in...
6
by: Silfheed | last post by:
Heyas So we have the following situation: we have a testee.py that we want to automatically test out and verifiy that it is worthy of being deployed. We want our tester.py to test the code for...
4
by: Nikhil | last post by:
I have recently written a small module. When I import the module, I always get the error only when I do -- Traceback (most recent call last): File "<stdin>", line 1, in <module>
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.