forked from kabukky/journey
-
Notifications
You must be signed in to change notification settings - Fork 0
/
local.go
20 lines (17 loc) · 788 Bytes
/
local.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package https
import (
"log"
"github.com/kabukky/httpscerts"
"github.com/kabukky/journey/configuration"
"github.com/kabukky/journey/filenames"
)
func checkCertificates() {
// Check https certificates. If they are not available generate temporary ones for testing.
if err := httpscerts.Check(filenames.HttpsCertFilename, filenames.HttpsKeyFilename); err != nil {
log.Println("Warning: couldn't load https certs. Generating new ones. Replace " + filenames.HttpsCertFilename + " and " + filenames.HttpsKeyFilename + " with your own certificates as soon as possible!")
if err := httpscerts.Generate(filenames.HttpsCertFilename, filenames.HttpsKeyFilename, configuration.Config.HttpsUrl); err != nil {
log.Fatal("Error: Couldn't create https certificates.")
return
}
}
}