hostname matching
hostname matching
Posted Jun 5, 2017 0:09 UTC (Mon) by njs (subscriber, #40338)In reply to: hostname matching by tialaramex
Parent article: Python ssl module update
Some security-conscious libraries like requests do already do their own IDN encoding, so that the stdlib functions only see the A-label.
> Over in m.d.s.policy we had discussions with Cory Benfield about the other end of this stuff - Cory sees that the CA trust relationships packaged up with a Linux distro, or with Python requests are only a crude partial summary of the actual CA trust exhibited by the browsers
Yeah, this is also unfortunate. Cory's currently engaged in a herculean effort to define a new TLS API for Python that can delegate to the platform TLS implementations on Windows and MacOS. I'm not sure that they're actually any better at this in practice, but at least it would reduce the number of distinct trust databases, and shift the responsibility away from the Python devs. Of course on Linux we can't even agree on where the list of trusted CAs gets put on disk, never mind any kind of more sophisticated policy decisions...
Posted Jun 5, 2017 1:10 UTC (Mon)
by tialaramex (subscriber, #21167)
[Link] (3 responses)
Arguably there is no such thing as "a valid certificate for faß.de" the certificate would be for xn--fa-hia.de, and it's purely a presentation layer decision to render this as faß.de. It certainly isn't correct to say "Oh, the user can type faß.de, we'll connect to the wrong machine, then give them a certificate error". That's not even a halfway acceptable solution.
There absolutely are CAs which will issue a certificate with a dnsName SAN for xn--fa-hia.de and then in CN they'll write faß.de because they can (the dnsName is deliberately defined with one of ASN.1's far too numerous sort-of ASCII encodings, so you can't write ß there, but CN is just arbitrary human-readable text...) However, checking CN for a Unicode version of the name is just compounding the original error, please don't do that either!
Posted Jun 8, 2017 7:33 UTC (Thu)
by njs (subscriber, #40338)
[Link] (2 responses)
In conclusion, TLS is hard and software is hard and everything is terrible.
Posted Jun 8, 2017 22:32 UTC (Thu)
by tialaramex (subscriber, #21167)
[Link] (1 responses)
From the Web PKI side, bugs like this mean when we say to CAs "Don't do X" they point at the bug and say "We have to because of this bug". And so another year or six goes by without the problem fixed. Python being part of the problem not the solution is disappointing.
Posted Jun 11, 2017 8:26 UTC (Sun)
by njs (subscriber, #40338)
[Link]
I also just alerted Cory to the issue in the hopes that his new TLS library will hopefully avoid this problem... the Python ssl maintainer(s) is (are) certainly aware of it, but the stdlib ssl module is (like everything) pretty under-resourced, and with the Python release cycle and the py2/py3 split getting this kind of complex change done can be really slow :-/
hostname matching
hostname matching
hostname matching
hostname matching
The lack of IDNA 2008 is: https://bugs.python.org/issue17305