MCPcopy
hub / github.com/cortesi/devd / getTLSConfig

Function getTLSConfig

server.go:55–66  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

53}
54
55func getTLSConfig(path string) (t *tls.Config, err error) {
56 config := &tls.Config{}
57 if config.NextProtos == nil {
58 config.NextProtos = []string{"http/1.1"}
59 }
60 config.Certificates = make([]tls.Certificate, 1)
61 config.Certificates[0], err = tls.LoadX509KeyPair(path, path)
62 if err != nil {
63 return nil, err
64 }
65 return config, nil
66}
67
68// This filthy hack works in conjunction with hostPortStrip to restore the
69// original request host after mux match.

Callers 3

ServeMethod · 0.85
TestGetTLSConfigFunction · 0.85
TestGenerateCertFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestGetTLSConfigFunction · 0.68
TestGenerateCertFunction · 0.68