Skip to content

session client tls BUGFIX TLS with newer OpenSSL - #659

Merged
michalvasko merged 2 commits into
develfrom
tls-hostname-keylog
Dec 1, 2026
Merged

michalvasko merged 2 commits into
develfrom
tls-hostname-keylog

Conversation

@Roytak

@Roytak Roytak commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Fixes TLS client failures with newer OpenSSL. It contains 2 changes:

  • a server address given as an IP address is now matched against the iPAddress entries of the certificate SAN, as RFC 9525 requires. until now it was accepted only through the CN, which OpenSSL 4.1 no longer checks,
  • test_tls passes with OpenSSL 3.5+ builds that write SSLKEYLOGFILE on their own (Fedora, Rocky 9).

With OpenSSL 4.1, server certificates without a SAN are rejected, so the test certificates are regenerated with one.

The client passed the server address to X509_VERIFY_PARAM_set1_host()
even when it was an IP address. That matches only dNSName SAN entries,
so an address in an iPAddress entry was never accepted and connecting
by address worked only through the fallback to the subject CN. OpenSSL
4.1 no longer consults the CN by default, so every connection by
address failed with a hostname mismatch.

An IP address is now matched against iPAddress SAN entries, as RFC 9525
requires; MbedTLS already does that. The test server certificates had
no SAN, they are regenerated with the same keys and issuers.
OpenSSL 3.5+ built with enable-sslkeylog writes the secrets to
SSLKEYLOGFILE on its own for every SSL_CTX. With the client and the
server in one process, the file holds each secret three times (client,
server and the libnetconf2 callback) and the exact count check failed
on Fedora and Rocky 9. The duplicates are identical lines, so count
each one once.
@michalvasko
michalvasko merged commit 66f1672 into devel Dec 1, 2026
17 checks passed
@michalvasko
michalvasko deleted the tls-hostname-keylog branch December 1, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants