-
Notifications
You must be signed in to change notification settings - Fork 4
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
Adding handling for expired intermediate certs when verifying client #788
Conversation
…xpired intermediate certificates
I should add 1 more test for a chain that is Also @aryanjassal have a quick review of this just to get an idea of the change. |
We need a new release for this for my node to continue working. |
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)) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
Starting something as true and then checking if it is true is just a bit weird even if you're later switching it to false. In fact it sounds like you should be doing an initial step on the head and then loop over the tail. These should be 2 different procedures.
23 Aug 2024 10:45:36 Brian Botha ***@***.***>:
…
***@***.**** commented on this pull request.
----------------------------------------
In src/nodes/utils.ts[#788 (comment)]:
> + 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)) {
As in, started as false and had a different name?
—
Reply to this email directly, view it on GitHub[#788 (comment)], or unsubscribe[https://github.com/notifications/unsubscribe-auth/AAE4OHNEIW7XC3PZ35VCDI3ZS2A25AVCNFSM6AAAAABMR4W3WGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDENJWGAYTGOJTGE].
You are receiving this because you commented.
[Tracking image][https://github.com/notifications/beacon/AAE4OHOU5SREWDEPRGBG37LZS2A25A5CNFSM6AAAAABMR4W3WGWGG33NNVSW45C7OR4XAZNRKB2WY3CSMVYXKZLTORJGK5TJMV32UY3PNVWWK3TUL5UWJTUGPAFGW.gif]
|
Description
This PR fixes a bug with expired intermediate certificates preventing connections when connecting with a client.
Issues Fixed
Fixes #787
Tasks
verifyClientCertificateChain
that prevented connections when we had an expired certificate when the chain should still be valid.verifyServerCertificateChain
for any similar issues.Final checklist