Skip to content

Commit

Permalink
Improve TLS (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsanchezmir authored Jun 12, 2024
1 parent 2a4d9ab commit 9c5b4c5
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,21 @@ func getListener(proxyCert string, proxyKey string) (net.Listener, error) {
cert, err := tls.X509KeyPair([]byte(proxyCert), []byte(proxyKey))
if err != nil {
klog.Fatal(err)

os.Exit(1)
}

return tls.Listen("tcp", proxyAddr, &tls.Config{
Certificates: []tls.Certificate{cert},
Certificates: []tls.Certificate{cert},
MinVersion: tls.VersionTLS12, // Set the minimum version of TLS to 1.2
MaxVersion: tls.VersionTLS13, // Set the maximum version of TLS to 1.3
PreferServerCipherSuites: true,
CipherSuites: []uint16{
tls.TLS_AES_256_GCM_SHA384,
tls.TLS_CHACHA20_POLY1305_SHA256,
tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
},
})
}

0 comments on commit 9c5b4c5

Please sign in to comment.