(ctx context.Context)
| 27 | const oneDay = 24 * time.Hour |
| 28 | |
| 29 | func (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 | |
| 39 | func (c *commandServerStart) startServerWithOptionalTLS(ctx context.Context, httpServer *http.Server) error { |
| 40 | var l net.Listener |
no test coverage detected