473,836 Members | 1,381 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

'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.HTTPSCo nnection('216.2 20.59.211',
7989)
https.debugleve l = 1
body = buildXML(data)
try:
https.request(' POST', '/Messenger/XMLMessenger',
body)
response = https.getrespon se()
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_requ est(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_outp ut()
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 7286
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
2603
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
1197
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 comment on it. I realize many of you already do this on your own--this is just sugar for the newbies. I'm releasing/announcing it for three reasons: 1. The ego rush of authorship, :D 2. I continually hear people asking for similar (if not...
18
3058
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 a single collections type, I should be proposing a new "namespaces" module instead. Some of my reasons: (1) Namespace is feeling less and less like a collection to me. Even though it's still intended as a data-only structure, the use cases...
4
2762
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 if it would be easy enough to create a code skeleton out of unit test module. Consider the following, though contrived, unit test code snippet: ==========================================================================
30
2080
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 serialize pass
0
1053
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, and you get back an SSL object that has write() and read() methods similar to a file object. However, what I don't get is the context you are supposed to use this object in. I thought that SSL was like a socket, but the transmission would be...
5
9540
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 send self.connect() File "H:\xampp\xampp\xampp\python\lib\httplib.py", line 1073, in connect ssl = socket.ssl(sock, self.key_file, self.cert_file)
6
3477
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 testee.py without changing the code for testee.py. testee.py has a module in it that we want to mock in some tests and in others use the real module. /foo.py: (real module) class bar:
4
6127
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
9825
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10854
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10559
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10601
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10260
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6981
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4460
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4023
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3116
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.