Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions internal/proxy/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ func GenerateSelfSignedTLS(dir string) (*TLSConfig, error) {
if err != nil {
return nil, fmt.Errorf("failed to parse CA certificate: %w", err)
}
logTLS.Printf("CA certificate created: serial=%s, notBefore=%s, notAfter=%s",
caSerial.String(), notBefore.Format(time.RFC3339), notAfter.Format(time.RFC3339))
Comment on lines +101 to +102
Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

PR description says this adds 3 new debug log calls (and 6 total), but the code adds 4 new log statements (CA created, server cert created, PEM files written, key pair loaded) for 6→? total. Please update the PR summary/table and line-count notes to match the actual change set to avoid confusion for reviewers/changelog.

Copilot uses AI. Check for mistakes.

// --- Generate server certificate ---
serverKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
Expand Down Expand Up @@ -128,6 +130,7 @@ func GenerateSelfSignedTLS(dir string) (*TLSConfig, error) {
if err != nil {
return nil, fmt.Errorf("failed to create server certificate: %w", err)
}
logTLS.Printf("server certificate created: dnsNames=%v, ipAddresses=%v", serverTemplate.DNSNames, serverTemplate.IPAddresses)

// --- Write files ---
caCertPath := filepath.Join(dir, "ca.crt")
Expand All @@ -148,12 +151,14 @@ func GenerateSelfSignedTLS(dir string) (*TLSConfig, error) {
if err := writePEM(keyPath, "EC PRIVATE KEY", serverKeyDER, 0600); err != nil {
return nil, fmt.Errorf("failed to write server key: %w", err)
}
logTLS.Printf("TLS certificate files written: caCert=%s, cert=%s, key=%s", caCertPath, certPath, keyPath)

// --- Build tls.Config ---
serverCertPair, err := tls.LoadX509KeyPair(certPath, keyPath)
if err != nil {
return nil, fmt.Errorf("failed to load server cert pair: %w", err)
}
logTLS.Print("TLS key pair loaded successfully")

tlsCfg := &tls.Config{
Certificates: []tls.Certificate{serverCertPair},
Expand Down
Loading