Hostnames With Trailing Dots Fail TLS Certificate Check In Sync Backend #1039
Unanswered
rjduffner
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When using httpx in a sync setting, we noticed that host names with trailing dots such as,
myhost.mycompany.internal.(to mark them as fully qualified in the dns) were failing withHowever, the same request without the trailing dot in the host name works just fine.
I've seen this issue a few times in various libraries and in all cases, it was solved by stripping off the dot off the end of the host name before sending it to ssl.
Note, the ssl team in python has said this is an application layer issue. (https://bugs.python.org/issue31997).
Here is what urllib3 does for this, https://github.com/urllib3/urllib3/blob/9ff0acf2391c80b363ddb08a566f38d707dc9826/src/urllib3/connection.py#L170-L186 if that helps at all.
For httpx and httpcore, I think for the sync side, the change should be in
httpcore.._backends.sync.py:48
Forgive my lack of knowledge on the async side but I think any fix there would be in the downstream libraries, anyio and trio.
Beta Was this translation helpful? Give feedback.
All reactions