Skip to content

Commit 96d0ad8

Browse files
authored
fix: harden TLS configuration to disable weak cipher suites (#119)
1 parent 7f55f53 commit 96d0ad8

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

service/proxy.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,16 +306,26 @@ func Start() {
306306
server := &http.Server{
307307
Addr: fmt.Sprintf(":%d", gatewayHttpsPort),
308308
TLSConfig: &tls.Config{
309+
// Minimum TLS version 1.2, TLS 1.3 is automatically supported
309310
MinVersion: tls.VersionTLS12,
311+
// Prefer server's cipher suite order for better security
312+
PreferServerCipherSuites: true,
313+
// Secure cipher suites for TLS 1.2 (excluding 3DES to prevent Sweet32 attack)
314+
// TLS 1.3 cipher suites are automatically configured by Go
310315
CipherSuites: []uint16{
311-
// Secure cipher suites for TLS 1.2 (excluding 3DES to prevent Sweet32 attack)
312316
tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
313317
tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
314318
tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
315319
tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
316320
tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
317321
tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
318322
},
323+
// Prefer strong elliptic curves
324+
CurvePreferences: []tls.CurveID{
325+
tls.X25519,
326+
tls.CurveP256,
327+
tls.CurveP384,
328+
},
319329
},
320330
}
321331

0 commit comments

Comments
 (0)