Merge request !1592 broke my testing setup
Hal Murray
halmurray at sonic.net
Thu Nov 12 09:14:01 UTC 2026
Gary said:
>> It worked for years. OpenSLL 4 broke things.
>> Turning on that flag fixed them.
> Which flag?
- SSL_set_hostflags(ssl, X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS);
+ SSL_set_hostflags(ssl, X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS |
X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT);
>> There is lots of logging on the client side.
>> You get things like this:
> Yeah, and often not enough.
If you (or anybody else) notice something missing, please let me know.
The server side is a lot simpler than the client. It doesn't have to
check the certificate. I've got that down to 1 line per connection. And
that can be split out to another file so it doesn't trash the main log
fiile.
The client side shouldn't happen very often so there is lots of logging
for each connection.
---------
From https://docs.openssl.org/3.3/man3/X509_check_host/
The X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT flag causes the function to consider the subject DN even if the certificate contains at least one subject alternative name of the right type (DNS name or email address as appropriate); the default is to ignore the subject DN when at least one corresponding subject alternative names is present.
From https://docs.openssl.org/4.1/man3/X509_check_host/
The X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT flag causes the function to also match against the subject DN (the commonName attribute for DNS names, the emailAddress attribute for email addresses), whether or not the certificate contains a subject alternative name of the corresponding type.
The git commit that dropped the flag says:
RFC 8915 section 3 requires clients to follow RFC 6125 when checking
the NTS-KE server's identity, and RFC 6125 section 6.4.4 forbids
matching the subject Common Name when the certificate has DNS names
in its Subject Alternative Name. ...
Drop the flag. Without it, X509_check_host(3) documents that the CN
is still checked when a certificate has no DNS SANs. A test
certificate that relies on its CN needs the name added as a DNS SAN,
or the client's server line needs noval.
------
I think I'll go work on making modern certificates.
--
These are my opinions. I hate spam.
More information about the devel
mailing list