473,805 Members | 2,003 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 7285
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
3055
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
2759
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
1052
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
9539
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
6122
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
9716
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
9596
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10360
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
10366
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
10105
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
9185
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7646
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5677
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3845
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.