473,586 Members | 2,754 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTTPS won't work, no matter which lib and how.

Hi.
I'm having some anoying trouble trying to establish a https connection.
I've even switched Python Versions (from 2.2.3 to 2.3.3), but the Errors
remain basically the same, allthough they now come in nice XML :-).

Here are some examples:

My last desperate try (which is way off the book):
import re
import base64
import httplib
import urllib2
import string
# don't know if I need this one, it doesn't fix anything it seems...
import socket

suffix = r"blah"
prefix = r"jada"

basicAuth = base64.encodest ring(prefix + r":" + suffix)

kopf = {"Basic": basicAuth}

req = urllib2.Request (url="https://myurl/", data="", headers = kopf)
fileLines = urllib2.https_o pen(req)
print "Recieved:"
print fileLines
<<<
This is the Error it throws:
./gethttps.py
Traceback (most recent call last):
File "./gethttps.py", line 30, in ?
fileLines = urllib2.https_o pen(req)
AttributeError: 'module' object has no attribute 'https_open'
The obvious one doesn't work either ALTHOUGH it's an Example from the
official urllib2 docs!!!:

import re
import base64
import httplib
import urllib2
import string
import socket

suffix = r"blah"
prefix = r"jada"

basicAuth = base64.encodest ring(prefix + r":" + suffix)

kopf = {"Basic": basicAuth}

req = urllib2.Request (url="https://myurl/", data="", headers = kopf)

fileLines = urllib2.urlopen (req)

print "Recieved:"
print fileLines
<<<
Here are the Errors throwed:
Traceback (most recent call last):
File "./gethttps.py", line 25, in ?
fileLines = urllib2.urlopen (req)
File "/usr/local/lib/python2.3/urllib2.py", line 129, in urlopen
return _opener.open(ur l, data)
File "/usr/local/lib/python2.3/urllib2.py", line 331, in open
'unknown_open', req)
File "/usr/local/lib/python2.3/urllib2.py", line 306, in _call_chain
result = func(*args)
File "/usr/local/lib/python2.3/urllib2.py", line 914, in unknown_open
raise URLError('unkno wn url type: %s' % type)
urllib2.URLErro r: <urlopen error unknown url type: https>

Does anybody have any Idea how I can open a https connection using
Python? The http, urllib and urllib2 in a whole seem quite a messy bunch
and I have had no success so far trying to grasp how to handle large
parts of them.
There are traces on the web saying that some socket stuff needs ssl
compiled into them in order for https stuff to work, but they seem old
and since I'm using the fresh original sources from www.python.org on a
Debian Linux system I presume that compiling should work A-OK.
If anybody thinks this is likeley to be a compiling issue, how and where
do I change the original source distribution to support https? In some
make or configure file maybe? I have no Idea. How do I find out if ssl
is supported in my install?
I'd be glad if someone could help, this all is driving me nuts.

Thanks.

Phillip

BTW: Since there is apsolutely no documentation on how to use the larger
part of urllib2's stuff on python.org it would be nice if someone could
also point out a howto or some working examples of how and in which
situations to use these classes and methods, such as OpenerDirector( ???)
and such.
Jul 18 '05 #1
1 3452
On 2004-05-17, Phillip <fo*******@no-spam.com> wrote:
Hi.
I'm having some anoying trouble trying to establish a https connection.
I've even switched Python Versions (from 2.2.3 to 2.3.3), but the Errors
remain basically the same, allthough they now come in nice XML :-).

Maybe this will help...

http://aspn.activestate.com/ASPN/Coo.../Recipe/267197

Jul 18 '05 #2

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

Similar topics

9
2609
by: Troot | last post by:
Hi all, In mind this is a daft question, but here goes. My hosts allow secure https logins on specific directories. What I want to do is have a login screen in flash, if the user enters the correct username and password I would like to set the HTTPS username and password using php/flash and then open the secure page. In my mind at this...
16
60589
by: Paul Sweeney | last post by:
Does anyone know of a working (python) https proxy which allows viewing of unencrypted data being sent from my browser to an https site? I've worked my way through most on the list at http://xhaus.com/alan/python/proxies.html, but while many claim to support https, if you actually point your browser at the proxies, they work fine for http,...
1
11093
by: Cindy Lee | last post by:
I'm trying to dynamically set the height of my Iframe. my https: main page is calling another https in an Iframe. But i get an access denied error from my javascript trying to call the parent document. Main https page <IFRAME APPLICATION="yes" style="width:100%;" id="iframename" frameborder="no" scrolling="no"...
14
2482
by: Peter Chant | last post by:
I'm currently authenticating a site I have built using basic http authentication built into apache. This has zero overhead on php which is a bonus but it seems to not quite work how I'd like. Are the username and password in the login box that comes up encrypted? When I login https://mysite.local:portnum I get the login dialog. As I am...
2
1518
by: Gareth | last post by:
Hello Why can't I run ASPX in SSL mode? i.e. I am developing locally (local IIS server) then uploading to a web site. The non-secure pages run okay. but when a link to an https page is clicked, it won't work. An HTML and ASP page do work, however.
7
4095
by: Richard L Rosenheim | last post by:
Anyone care to express their two cents over pros and cons of encrypting the data being transmitted (within the SOAP package) versus just utilizing a HTTPS connection? Richard Rosenheim
1
2227
by: batista | last post by:
Hi, I'm using webservice.htc to call a non-secure(without https) webservice method from a webpage. Now, if the webpage is not under https then everything works fine. But, when enable ssl in that page the webservice method does'nt work. So how shud i solve this.
2
1885
by: patilj | last post by:
OK, here's the deal. Let's say I got a website called: https://www.blah.com/~account/application/login.php When the user arrives they see a https which is more secure than just http alone. The problem for me is it is too slow because it's shared with others (but at least it's free), and I'm too cheap to shell out the money for my own,...
4
2091
by: bkasmai | last post by:
My asp.net application (developed using vs2003) runs fine on a windows 2000 server using iis 5.0. Our network manager wants to do away with any http connections and only use https for services that are used by external users. I have not got a clue how to go about this. My users are authenticated directly by querying a sql table where the user...
0
8338
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...
1
7954
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...
0
8215
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...
0
6610
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...
1
5710
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...
0
5390
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...
0
3836
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2345
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
0
1179
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...

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.