MCPcopy Create free account
hub / github.com/celzero/midway / TlsCerts

Function TlsCerts

midway/env/env.go:74–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

72}
73
74func TlsCerts() (*tls.Certificate, []string) {
75 certpem, keypem := tlsKeyCertPem() // prod
76 certfile := tlsCertFile() // test
77 keyfile := tlsKeyFile() // test
78
79 if crt, err := tls.X509KeyPair(certpem, keypem); err == nil {
80 log.Print("tls w key/crt PEM")
81 return &crt, sni(&crt)
82 } else if crt, err := tls.LoadX509KeyPair(certfile, keyfile); err == nil {
83 log.Print("tls w key/crt FILE")
84 return &crt, sni(&crt)
85 } else {
86 return nil, nil
87 }
88}
89
90func FlyAppName() string {
91 return strenv("FLY_APP_NAME", "")

Callers 2

server.goFile · 0.92
TlsConfigFunction · 0.85

Calls 4

tlsKeyCertPemFunction · 0.85
tlsCertFileFunction · 0.85
tlsKeyFileFunction · 0.85
sniFunction · 0.85

Tested by

no test coverage detected