MCPcopy
hub / github.com/kopia/kopia / generateServerCertificate

Method generateServerCertificate

cli/command_server_tls.go:29–37  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

27const oneDay = 24 * time.Hour
28
29func (c *commandServerStart) generateServerCertificate(ctx context.Context) (*x509.Certificate, *rsa.PrivateKey, error) {
30 cert, key, err := tlsutil.GenerateServerCertificate(
31 ctx,
32 c.serverStartTLSGenerateRSAKeySize,
33 time.Duration(c.serverStartTLSGenerateCertValidDays)*oneDay,
34 c.serverStartTLSGenerateCertNames)
35
36 return cert, key, errors.Wrap(err, "error generating server certificate")
37}
38
39func (c *commandServerStart) startServerWithOptionalTLS(ctx context.Context, httpServer *http.Server) error {
40 var l net.Listener

Callers 2

maybeGenerateTLSMethod · 0.95

Calls 2

DurationMethod · 0.45

Tested by

no test coverage detected