MCPcopy Create free account
hub / github.com/ContentSquare/chproxy / serveTLS

Function serveTLS

main.go:157–171  ·  view source on GitHub ↗
(cfg config.HTTPS)

Source from the content-addressed store, hash-verified

155}
156
157func serveTLS(cfg config.HTTPS) {
158 ln := newListener(cfg.ListenAddr)
159
160 h := http.HandlerFunc(serveHTTP)
161
162 tlsCfg, err := cfg.TLS.BuildTLSConfig(autocertManager)
163 if err != nil {
164 log.Fatalf("cannot build TLS config: %s", err)
165 }
166 tln := tls.NewListener(ln, tlsCfg)
167 log.Infof("Serving https on %q", cfg.ListenAddr)
168 if err := listenAndServe(tln, h, cfg.TimeoutCfg); err != nil {
169 log.Fatalf("TLS server error on %q: %s", cfg.ListenAddr, err)
170 }
171}
172
173func serve(cfg config.HTTP) {
174 var h http.Handler

Callers 1

mainFunction · 0.85

Calls 5

FatalfFunction · 0.92
InfofFunction · 0.92
newListenerFunction · 0.85
listenAndServeFunction · 0.85
BuildTLSConfigMethod · 0.80

Tested by

no test coverage detected