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


Groups > comp.lang.python > #7674

Re: Question regarding DNS resolution in urllib2

References <E284F771-80D9-4F21-9935-1D61E76F8B01@gmail.com> <BANLkTik8pc5aAiS2Y0KQqPfa80jU1ckFDQ@mail.gmail.com> <13FAA3D4-ED1D-47AC-BADA-FD5C2D3729B7@gmail.com>
Date 2011-06-15 16:45 +1000
Subject Re: Question regarding DNS resolution in urllib2
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.259.1308120313.11593.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, Jun 15, 2011 at 4:23 PM, saurabh verma <nitw.saurabh@gmail.com> wrote:
> But in the case of https , I can do above because https handshake is based on the domain i am trying to connect , so lets say I want to following inside a python  script using libcurl2 but without touching /etc/hosts ,
>
> curl “https://something.com” , now something.com will try to connect to either IPA or IPB which I don’t have control over , I know internally it must be calling a DNS resolver libarary of python , I want to control over that , may be libcurl2 exposing a function to do some DNS altering .

If you edit your hosts file, it will affect where something.com points
- you can force it to be IPA and then test, then force it to IPB and
test. You'll still be downloading https://something.com so the HTTPS
handshake should work exactly the same way.

Chris Angelico

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


Thread

Re: Question regarding DNS resolution in urllib2 Chris Angelico <rosuav@gmail.com> - 2011-06-15 16:45 +1000

csiph-web