13 lines · 270 bytes
1package main
2
3import "crypto/tls"
4
5// serverTLS sets the HTTPS listener's protocol floor: TLS 1.2 and 1.3,
6// with Go's default cipher suites.
7func serverTLS(c *tls.Config) *tls.Config {
8 if c == nil {
9 c = &tls.Config{}
10 }
11 c.MinVersion = tls.VersionTLS12
12 return c
13}