Skip to content

Is custom name resolution implemented? #2592

Answered by tomchristie
Allgot asked this question in Q&A
Discussion options

You must be logged in to vote

Apologies for the slow reply...

Could I provide both of an IP address and a hostname, in a clearer way?

So... I think there's an improvement that we could make here.

Can you send a request to a specific IP, well yes...

>>> httpx.get("http://142.250.200.36:80/", headers={"Host": "www.google.com"})
<Response [200 OK]>

But this won't work for SSL requests...

>>> httpx.get("https://142.250.200.36:443/", headers={"Host": "www.google.com"})
...
httpx.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:997)

This fails because it is attempting to sign the SSL cert with '142.250.200.36'.

We could change this behaviour in httpcore, so that for…

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@karpetrosyan
Comment options

@Allgot
Comment options

@karpetrosyan
Comment options

@Allgot
Comment options

@Allgot
Comment options

Answer selected by Allgot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants