Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #45816

Re: Error with python 3.3.2 and https

References <683480d3-9b36-40f3-af61-e767178ceb87@googlegroups.com>
Date 2013-05-24 01:56 +1000
Subject Re: Error with python 3.3.2 and https
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2019.1369324579.3114.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, May 24, 2013 at 1:48 AM,  <asianavatar@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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Error with python 3.3.2 and https asianavatar@gmail.com - 2013-05-23 08:48 -0700
  Re: Error with python 3.3.2 and https Chris Angelico <rosuav@gmail.com> - 2013-05-24 01:56 +1000
    Re: Error with python 3.3.2 and https asianavatar@gmail.com - 2013-05-23 09:12 -0700
      Re: Error with python 3.3.2 and https Chris Angelico <rosuav@gmail.com> - 2013-05-24 02:18 +1000
        Re: Error with python 3.3.2 and https asianavatar@gmail.com - 2013-05-23 10:49 -0700
          Re: Error with python 3.3.2 and https Chris Angelico <rosuav@gmail.com> - 2013-05-24 08:23 +1000
            Re: Error with python 3.3.2 and https asianavatar@gmail.com - 2013-05-24 11:08 -0700

csiph-web