0

I want my program make himself the dns resolution for http requests. It permits the user to make the requests only on IPv4 or IPv6 ( -4/-6 options ) or to randomize the destination to make a simple load balancing. To simplify my life, I use urllib3.

In http, it's easy. I make request on the "ip url" ( http://X.X.X.X/...) and I add the hostname in the request header.

But for security reasons, I need use https. I don't find how spécify the hostname to checked. I found the argument "server_hostname" for the ssl wrapper, but i didn't found how use it.

Some one know how give to urllib3/ssl the hostname to check ?

An other solution could be to specify to urllib3 the ip for an host.

If you have an idea ?

Or maybe the only solution is to make the https/ssl request myself ?

Regards

Pierre B
  • 51
  • 7
  • Use a custom DNS resolver; I've duped you to an answer that lets you hook into the resolving step. The alternative is to add the IP addresses to your `/etc/hosts` file. – Martijn Pieters Sep 18 '15 at 14:14
  • I will check your first answer before. Modified the /etc/hosts is not a good idea for distribute the software. Thank for the answers. – Pierre B Sep 18 '15 at 14:26

0 Answers0