feat: allow TLS connections with invalid certificate if the key is unchanged#8086
Merged
feat: allow TLS connections with invalid certificate if the key is unchanged#8086
Conversation
link2xt
commented
Apr 5, 2026
dfce584 to
000bf71
Compare
000bf71 to
900cb7f
Compare
j-g00da
approved these changes
Apr 17, 2026
900d88c to
e352efe
Compare
e352efe to
a8947ec
Compare
link2xt
commented
Apr 17, 2026
f62aab7 to
3e05546
Compare
iequidoo
reviewed
Apr 17, 2026
iequidoo
approved these changes
Apr 17, 2026
3e05546 to
280d93d
Compare
iequidoo
reviewed
Apr 17, 2026
iequidoo
approved these changes
Apr 17, 2026
…changed This change weakens TLS checks. Every time we make a successful TLS connection, we remember public key hash from the certificate in relation to the hostname. If later we connect to the same hostname and the public key does not change, we skip checking certificate chain. This way we will still connect successfully even if certificate expires or becomes invalid for another reason, but keeps the key. We always check that certificate corresponds to the hostname. We also do this for certificates starting with _ where we allow self-signed certificates, so self-signed certificates with mismatching domains are not allowed. Previously we did not check this for domains starting with _.
280d93d to
2a74f65
Compare
link2xt
commented
Apr 18, 2026
| let now = time(); | ||
| let removed_hosts = sql | ||
| .query_map_vec( | ||
| "DELETE FROM tls_spki WHERE ? > timestamp + ? RETURNING host", |
Collaborator
Author
There was a problem hiding this comment.
DELETE does not work from query_map_vec because it is executed on read connection.
I made a follow-up PR #8135
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change weakens TLS checks.
Every time we make a successful TLS connection,
we remember public key hash from the certificate
in relation to the hostname.
If later we connect to the same hostname and the public key does not change,
we skip checking certificate chain.
This way we will still connect successfully
even if certificate expires or becomes invalid for another reason,
but keeps the key.
We always check that certificate corresponds to the hostname.
We also do this for certificates starting with _
where we allow self-signed certificates,
so self-signed certificates with mismatching domains are not allowed.
Previously we did not check this for domains starting with _.
Closes #7996