473,598 Members | 3,369 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

UrlLib2 Proxy and Https

Hello,

I would like to access an HTTPS site via a proxy
The following code is working for HTTP://www.hotmail.com but not for HTTPS
I have try with other sites without success

l_proxy_info = {
'user' : mylogin,
'pass' : mypassword,
'host' : myproxy,
'port' : 8080
}

l_proxy_support = urllib2.ProxyHa ndler({"http" : \
"http://%(user)s:%(pass )s@%(host)s:%(p ort)d" %
l_proxy_info})
l_opener = urllib2.build_o pener(l_proxy_s upport, urllib2.HTTPHan dler)

urllib2.install _opener(l_opene r)
l_req = urllib2.urlopen ('https://www.hotmail.com/')
print l_req.headers
print l_req.read()

Thanks for your help, ;-)
Jacobo
Jul 18 '05 #1
4 3854
Tom
> I would like to access an HTTPS site via a proxy
The following code is working for HTTP://www.hotmail.com but not for HTTPS
I have try with other sites without success

l_proxy_info = {
'user' : mylogin,
'pass' : mypassword,
'host' : myproxy,
'port' : 8080
}


I have no idea if this is your problem, but you are aware that https is
usually on port 443, not 80 or 8080 like http?

HTH

Tom
Jul 18 '05 #2
I have made some tests with Curl and this proxy setting is correct
It's seems that there is a problem with HTTPS and urllib2 + proxy
Bye,
Jacobo
"Tom" <t@b.c> wrote in message news:mf******** ***********@new s.xtra.co.nz...
I would like to access an HTTPS site via a proxy
The following code is working for HTTP://www.hotmail.com but not for HTTPS I have try with other sites without success

l_proxy_info = {
'user' : mylogin,
'pass' : mypassword,
'host' : myproxy,
'port' : 8080
}


I have no idea if this is your problem, but you are aware that https is
usually on port 443, not 80 or 8080 like http?

HTH

Tom

Jul 18 '05 #3
Check out the following link. It helped me achieve the same thing
(access a HTTPS site via a proxy).

http://groups.yahoo.com/group/linux-...g/message/4208
Cheers,
Sandeep
http://sandeep.weblogs.us/

Jul 18 '05 #4
Thanks ;-)
Jacobo
"Sandeep" <sa******@gmail .com> wrote in message
news:11******** *************@f 14g2000cwb.goog legroups.com...
Check out the following link. It helped me achieve the same thing
(access a HTTPS site via a proxy).

http://groups.yahoo.com/group/linux-...g/message/4208
Cheers,
Sandeep
http://sandeep.weblogs.us/

Jul 18 '05 #5

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

Similar topics

4
21096
by: O. Koch | last post by:
Until now, i know that ftplib doesn't support proxies and that i have to use urllib2. But i don't know how to use the urllib2 correct. I found some examples, but i don't understand them. Is there anyone who can help me?
0
2060
by: Benjamin Schollnick | last post by:
Folks, With Windows XP, and Python v2.41 I am running into a problem.... The following code gives me an unknown protocol error.... And I am not sure how to resolve it... I have a API written for DocuShare for a non-SSL server, and I wanted to update it
1
9737
by: Bloke | last post by:
I want to connect to a https server through an authenticating proxy like this: import urllib2 proxy_info = { 'user' : 'me', 'pass' : 'password', 'host' : 'mycompany.com.au', 'port' : 8008 }
0
1228
by: Fuzzyman | last post by:
Hello all (well, some of you I guess), Is it true that you can't configure a proxy handler for urllib2 to fetch https URLs through a proxy ? I know that you pass a dictionary, keyed by protocol, to the proxy handler - but when we get an exception when we fetch an https URL. Fetching the same URL, through the same proxy, with a browser works fine.
1
3359
by: Ray Slakinski | last post by:
Hello, I have defined a function to set an opener for urllib2, this opener defines any proxy and http authentication that is required. If the proxy has authencation itself and requests an authenticated file I get a HTTP status code of 401 (Unauthorized access of the file being requested) I do see in the headers the Proxy-authorization and the Authorization headers being sent for the request.
3
3075
by: itay_k | last post by:
Hi, I am running the following simple code (just open connection to some https page with proxy): proxy= '666.179.227.666:80' proxy=urllib2.ProxyHandler({"https":'https://'+proxy}) opener = urllib2.build_opener(proxy) request = urllib2.Request('https://somehttpspage....') response = opener.open(request)
0
2440
by: Ali.Sabil | last post by:
hello all, I just maybe hit a bug in both urllib and urllib2, actually urllib doesn't support proxy authentication, and if you setup the http_proxy env var to http_proxy=http://user:passwd@host:port/ and https_proxy=$http_proxy i get a traceback : Traceback (most recent call last): File "test_urllib.py", line 2, in ? urllib.urlopen("https://sf.net/")
1
2880
by: Astan Chee | last post by:
Hi again, According to https://demo.launchpad.net/products/python/+bug/56872 or more specifically, the example of its working code: http://librarian.demo.launchpad.net/3507227/urllib2_proxy_auth.py I can use urllib2 via proxy to access a https site(specifically hooking it up to libgmail). The problem is that the proxy that is accessible to me is http/port8080 only. Is it possible to use urllib2 with this proxy to access a https site?...
1
3963
by: cp.finances.gouv | last post by:
Hello all, I'm facing a strange behavior of urllib2 trying to access gmail account behind a proxy (Squid). The following works perfectly : wget --save-cookies cookies --keep-session-cookies --post- data="Email=externe.finances.gouv@gmail.com&Passwd=cpfinances" --no- check-certificate -O - https://www.google.com/accounts/ServiceLoginBoxAuth
0
7991
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
7902
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
8398
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
8050
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
6719
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...
0
3898
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3939
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2412
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
1
1504
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.