473,499 Members | 1,689 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.ProxyHandler({"http" : \
"http://%(user)s:%(pass)s@%(host)s:%(port)d" %
l_proxy_info})
l_opener = urllib2.build_opener(l_proxy_support, urllib2.HTTPHandler)

urllib2.install_opener(l_opener)
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 3843
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*******************@news.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*********************@f14g2000cwb.googlegro ups.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
21078
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...
0
2052
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...
1
9723
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
1222
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...
1
3347
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...
3
3067
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 =...
0
2429
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...
1
2870
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:...
1
3954
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...
0
7134
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
7014
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...
0
7180
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
7395
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...
0
5485
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,...
0
4609
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...
0
3103
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1429
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 ...
1
667
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.