()
| 13 | ) |
| 14 | |
| 15 | func TlsConfig() *tls.Config { |
| 16 | // ref: cs.opensource.google/go/go/+/refs/tags/go1.18:src/net/http/h2_bundle.go;drc=refs%2Ftags%2Fgo1.18;l=3983 |
| 17 | certificate, _ := TlsCerts() |
| 18 | if certificate == nil { |
| 19 | log.Print("empty cert") |
| 20 | return nil |
| 21 | } |
| 22 | c := []tls.Certificate{*certificate} |
| 23 | |
| 24 | alpn := []string{"h2", "http/1.1"} |
| 25 | |
| 26 | // ref: github.com/caddyserver/caddy/blob/c48fadc/modules/caddytls/connpolicy.go#L441 |
| 27 | // ref: github.com/folbricht/routedns/blob/35c9051/tls.go#L12 |
| 28 | return &tls.Config{ |
| 29 | Certificates: c, |
| 30 | MinVersion: tls.VersionTLS12, |
| 31 | NextProtos: alpn, |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | func sni(cx *tls.Certificate) []string { |
| 36 | // ref: cs.opensource.google/go/go/+/refs/tags/go1.18.1:src/crypto/tls/tls.go;drc=860704317e02d699e4e4a24103853c4782d746c1;l=252 |
no test coverage detected