Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/gbaeke/nasnet-go
Browse files Browse the repository at this point in the history
  • Loading branch information
gbaeke committed Mar 2, 2019
2 parents 85cbd91 + 43fe157 commit 42075c2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.go
Expand Up @@ -52,19 +52,21 @@ func main() {
//check environment variable to enable SSL
sslEnabled := getEnv("ssl", "false")
hostName := getEnv("hostname", "")
stagingCA := getEnv("staging", "true")
if hostName == "" && sslEnabled == "true" {
log.Fatalln("Specify hostname environment variable when SSL is on")
}
stagingCA := getEnv("staging", "true")

if sslEnabled == "true" {
log.Println("SSL is on")
// certmagic
certmagic.Agreed = true
certmagic.Email = "mail@mail.com"
if stagingCA == "false" {
log.Println("Using production CA")
certmagic.CA = certmagic.LetsEncryptProductionCA
} else {
log.Println("Using staging CA")
certmagic.CA = certmagic.LetsEncryptStagingCA
}

Expand Down

0 comments on commit 42075c2

Please sign in to comment.