On Fri, May 24, 2013 at 1:48 AM, <asianava...@gmail.com> wrote: > I am trying to write a program that requires me hitting a https web link. > However, I can't seem to get it to work. The program works fine when dealing > with http sites, however, when I try it with a https site I get > > socket.gaierror: [Errno 11001] getaddrinfo failed > > It seems like it has something to do with the ssl not working, however, I do > have the ssl.py in the python library and I have no problem importing it. > > My code is below. Any help would be greatly appreciated. > > import urllib.request > auth = urllib.request.HTTPSHandler() > proxy = urllib.request.ProxyHandler({'http':'my proxy'}) > opener = urllib.request.build_opener(proxy, auth) > f = opener.open('http://www.google.ca/')
Check the name of your proxy; maybe you can't resolve it. Can you identify your proxy by IP address? By omitting the proxy part, I can quite happily make a direct request using code like yours. ChrisA -- http://mail.python.org/mailman/listinfo/python-list