listen on all, not just localhost
This commit is contained in:
parent
1555f89305
commit
9d731726e9
8
main.go
8
main.go
@ -33,7 +33,7 @@ func main() {
|
|||||||
mime.AddExtensionType(".gemini", "text/gemini")
|
mime.AddExtensionType(".gemini", "text/gemini")
|
||||||
mime.AddExtensionType(".gmi", "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
|
var cer tls.Certificate
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Info("Generating new certificate...")
|
log.Info("Generating new certificate...")
|
||||||
@ -42,14 +42,14 @@ func main() {
|
|||||||
log.Info("error generating certificates", err)
|
log.Info("error generating certificates", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = certificates.WriteCertsToFile("./cert.pem", "./key.pem", cert, key)
|
err = certificates.WriteCertsToFile("./certs/cert.pem", "./certs/key.pem", cert, key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Info("error saving certificates", err)
|
log.Info("error saving certificates", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cer, err = tls.LoadX509KeyPair("./cert.pem", "./key.pem")
|
cer, err = tls.LoadX509KeyPair("./certs/cert.pem", "./certs/key.pem")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Info("error loading certificates", err)
|
log.Info("error loading certificates", err)
|
||||||
return
|
return
|
||||||
@ -60,7 +60,7 @@ func main() {
|
|||||||
MinVersion: tls.VersionTLS12,
|
MinVersion: tls.VersionTLS12,
|
||||||
}
|
}
|
||||||
|
|
||||||
listener, err := tls.Listen("tcp", "localhost:1965", &tlsc)
|
listener, err := tls.Listen("tcp", ":1965", &tlsc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Info(err)
|
log.Info(err)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user