Implement persistent certificate storage with reuse for self-signed SSL#6
Implement persistent certificate storage with reuse for self-signed SSL#6
Conversation
Co-authored-by: warkanum <208308+warkanum@users.noreply.github.com>
Co-authored-by: warkanum <208308+warkanum@users.noreply.github.com>
pkg/server/manager.go
Outdated
|
|
||
| // Clean up temporary certificate directory if it exists | ||
| if s.tempCertDir != "" { | ||
| if cleanupErr := os.RemoveAll(s.tempCertDir); cleanupErr != nil { |
There was a problem hiding this comment.
@copilot We don't need to clean up. We also need to insure to always generate certificates with the same name as to override the old ones. However, if the certificates exists, use them if they are not expired.
There was a problem hiding this comment.
Changed the approach in commit 4f8edd6. Certificates are now stored persistently in {UserCacheDir}/resolvespec/certs/ with consistent naming based on hostname. The system checks for existing certificates and reuses them if valid (not expired, not expiring within 30 days). New certificates are only generated when needed, overwriting any old ones.
pkg/server/manager_test.go
Outdated
| assert.True(t, executed, "Shutdown callback should have been executed") | ||
| } | ||
|
|
||
| func TestSelfSignedSSLCleanup(t *testing.T) { |
There was a problem hiding this comment.
Removed TestSelfSignedSSLCleanup in commit ccf8522 and added TestSelfSignedSSLCertificateReuse to verify the new certificate reuse functionality works correctly.
Co-authored-by: warkanum <208308+warkanum@users.noreply.github.com>
Co-authored-by: warkanum <208308+warkanum@users.noreply.github.com>
Self-signed SSL certificates are now stored persistently and reused across server restarts, eliminating the need for cleanup and improving performance.
Changes
{UserCacheDir}/resolvespec/certs/with consistent naming based on hostnameTestSelfSignedSSLCertificateReuseto verify certificate reuse functionalityImplementation
Certificates are stored with consistent naming and reused when valid:
Only self-signed SSL certificates use persistent storage; user-provided certs and AutoTLS are unaffected.
Benefits
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.