-
Notifications
You must be signed in to change notification settings - Fork 37
Add automatic TLS client certificate refresh support #732
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
base: main
Are you sure you want to change the base?
Conversation
e6ef17f to
871a6e4
Compare
871a6e4 to
bc732ea
Compare
| */ | ||
| private async attemptCertificateRefresh(): Promise<boolean> { | ||
| if (!this.#options.onCertificateExpired) { | ||
| return false; |
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.
suggestion: How about we log that the cert is expired and there's nothing we can do about it because we haven't been told how to refresh the client cert?
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.
We actually always pass a handler in production so I'll just make it required (we can pass () => false if need be)
| ### Fixed | ||
|
|
||
| - Fixed `SetEnv` SSH config parsing and accumulation with user-defined values. | ||
| - Improved WebSocket error handling for more consistent behavior across connection failures. |
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.
nit: other PR?
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 mentioned in #732 (comment), this was always in issue but I only noticed it now when catching cert errors
…en they fail - New coder.tlsCertRefreshCommand setting to configure a refresh command (e.g., metatron refresh) - Detects 7 SSL/TLS client certificate alert codes: expired, revoked, bad certificate, unknown, unsupported, unknown CA, and access denied - Classifies errors as "refreshable" (expired, revoked, bad, unknown) vs "non-refreshable" (unsupported, unknown CA, access denied) - Automatically executes refresh command and retries failed HTTP requests and WebSocket connections - Shows user-friendly notifications with appropriate guidance based on error type - Split CertificateError into ServerCertificateError (server cert issues) and ClientCertificateError (client cert issues) - Added execCommand utility for shared command execution with proper logging
0f9c982 to
46800c3
Compare
Summary
coder.tlsCertRefreshCommandsetting to configure a refresh command (e.g.,metatron refresh)Changes
Certificate Error Handling
CertificateErrorintoServerCertificateError(server cert issues) andClientCertificateError(client certissues)
and access denied. Also classify errors as "refreshable" (expired, revoked, bad, unknown) vs "non-refreshable" (unsupported, unknown CA, access denied)
Automatic Refresh & Retry
Code Quality
execCommandutility for shared command execution with proper loggingFixed #714