MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / loadCert

Function loadCert

core/server/server.go:153–169  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

151}
152
153func loadCert() *tls.Certificate {
154 certPath := path.Join(global.CONF.Base.InstallDir, "1panel/secret/server.crt")
155 keyPath := path.Join(global.CONF.Base.InstallDir, "1panel/secret/server.key")
156 certificate, err := os.ReadFile(certPath)
157 if err != nil {
158 panic(err)
159 }
160 key, err := os.ReadFile(keyPath)
161 if err != nil {
162 panic(err)
163 }
164 cert, err := tls.X509KeyPair(certificate, key)
165 if err != nil {
166 panic(err)
167 }
168 return &cert
169}
170
171func handleMuxHttpConn(conn net.Conn) {
172 defer conn.Close()

Callers 1

StartFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected