diff --git a/main.go b/main.go index 8147d30..972bc44 100644 --- a/main.go +++ b/main.go @@ -33,7 +33,7 @@ func main() { mime.AddExtensionType(".gemini", "text/gemini") mime.AddExtensionType(".gmi", "text/gemini") - err := certificates.TestCertificateExists("./cert.pem", "./key.pem") + err := certificates.TestCertificateExists("./certs/cert.pem", "./certs/key.pem") var cer tls.Certificate if err != nil { log.Info("Generating new certificate...") @@ -42,14 +42,14 @@ func main() { log.Info("error generating certificates", err) return } - err = certificates.WriteCertsToFile("./cert.pem", "./key.pem", cert, key) + err = certificates.WriteCertsToFile("./certs/cert.pem", "./certs/key.pem", cert, key) if err != nil { log.Info("error saving certificates", err) return } } - cer, err = tls.LoadX509KeyPair("./cert.pem", "./key.pem") + cer, err = tls.LoadX509KeyPair("./certs/cert.pem", "./certs/key.pem") if err != nil { log.Info("error loading certificates", err) return @@ -60,7 +60,7 @@ func main() { MinVersion: tls.VersionTLS12, } - listener, err := tls.Listen("tcp", "localhost:1965", &tlsc) + listener, err := tls.Listen("tcp", ":1965", &tlsc) if err != nil { log.Info(err) return