generate certs files only when not existent

This commit is contained in:
Adrian Zürcher
2025-04-30 08:27:40 +02:00
parent c310414b7e
commit f5890c1563
3 changed files with 8 additions and 550 deletions

View File

@@ -26,5 +26,8 @@ func (s *Server) ServeHttp(port uint) error {
}
func (s *Server) ServeHttps(port uint, cert cert.Cert) error {
if err := cert.GenerateSelfSignedCert(); err != nil {
return err
}
return s.Routes.RunTLS(fmt.Sprintf(":%d", port), cert.CertFile, cert.KeyFile)
}