Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding handling for expired intermediate certs when verifying client #788

Conversation

tegefaulkes
Copy link
Contributor

@tegefaulkes tegefaulkes commented Aug 15, 2024

Description

This PR fixes a bug with expired intermediate certificates preventing connections when connecting with a client.

Issues Fixed

Fixes #787

Tasks

  • 1. Fix bug in verifyClientCertificateChain that prevented connections when we had an expired certificate when the chain should still be valid.
  • 2. Check verifyServerCertificateChain for any similar issues.
  • 3. Expand tests to check for this edge case with expired intermediate certificates

Final checklist

  • Domain specific tests
  • Full tests
  • Updated inline-comment documentation
  • Lint fixed
  • Squash and rebased
  • Sanity check the final build

@tegefaulkes tegefaulkes self-assigned this Aug 15, 2024
Copy link

linear bot commented Aug 15, 2024

@tegefaulkes
Copy link
Contributor Author

I should add 1 more test for a chain that is [valid-leaf, expired, valid-target, root].

Also @aryanjassal have a quick review of this just to get an idea of the change.

@tegefaulkes tegefaulkes merged commit 5b90f80 into staging Aug 16, 2024
36 checks passed
@CMCDragonkai
Copy link
Member

We need a new release for this for my node to continue working.

Comment on lines +650 to +654
let leafCert = true;
for (let certIndex = 0; certIndex < certChain.length; certIndex++) {
const cert = certChain[certIndex];
const certNext = certChain[certIndex + 1];
if (now < cert.notBefore || now > cert.notAfter) {
if (leafCert && (now < cert.notBefore || now > cert.notAfter)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit confusing when it's set to true and then checked. The order of switching booleans may be clearer if it was the other way around.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in, started as false and had a different name?

@CMCDragonkai
Copy link
Member

CMCDragonkai commented Aug 23, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Expired intermediate certificates prevents maintaining connections
2 participants