Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'importing': 0.05; 'skip:u 30': 0.07; 'subject:Error': 0.07; 'http': 0.09; 'part,': 0.09; 'python': 0.11; '1:48': 0.16; '24,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'happily': 0.16; 'https': 0.16; 'omitting': 0.16; 'subject:https': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'library': 0.18; 'trying': 0.19; 'seems': 0.21; 'import': 0.22; 'proxy': 0.24; 'ssl': 0.24; 'fine': 0.24; 'header:In-Reply-To:1': 0.27; 'appreciated.': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'work.': 0.31; 'code': 0.31; 'quite': 0.32; 'fri,': 0.33; 'link.': 0.33; 'maybe': 0.34; 'problem': 0.35; 'subject:with': 0.35; "can't": 0.35; 'skip:u 20': 0.35; 'something': 0.35; 'received:google.com': 0.35; 'to:addr :python-list': 0.38; 'to:addr:python.org': 0.39; 'skip:u 10': 0.60; 'identify': 0.61; 'name': 0.63; 'direct': 0.67; 'below.': 0.71; 'opener': 0.84; 'working,': 0.84; 'yours.': 0.93; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=OH0BK8UA9aIyNgKcNhDF7TZVUSwA2MnZ/i1yEtwLwJg=; b=EvO9v45uKokVQ4DvIy8aem2NwU2ZqNsewARe9QOMfr0yr9AkVq3SGbekUEOPZeKbw0 d0gLCGtTgT0jhThLfq7A35CcDXna4uPwQczLKlXQwqmq1dU0uOofnFTbYHKDgDM4Kg8p D7FlzskjvbKaCkT0ocRPNsLtcXK5mHplspIIwRIDtMCzGOL1tbIriQ+A2B8ONyXE5shi QnlQG7v+Cr6cT4r6Exrr0rbaFSyb2SgoYlXWICNyaR0CSdJJQfp/cKeZBH57Ss/cQ9ta D6U9ri45LbcfCwDZrPFYPArl05AE6IL1eNOoqgqhjW/9wvhY3YhgPZQoO5NHlPeWEDx3 HQ1w== MIME-Version: 1.0 X-Received: by 10.220.109.66 with SMTP id i2mr5693627vcp.51.1369324571485; Thu, 23 May 2013 08:56:11 -0700 (PDT) In-Reply-To: <683480d3-9b36-40f3-af61-e767178ceb87@googlegroups.com> References: <683480d3-9b36-40f3-af61-e767178ceb87@googlegroups.com> Date: Fri, 24 May 2013 01:56:11 +1000 Subject: Re: Error with python 3.3.2 and https From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369324579 news.xs4all.nl 15872 [2001:888:2000:d::a6]:60016 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:45816 On Fri, May 24, 2013 at 1:48 AM, 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