Skip to content

Commit

Permalink
Fix double sertificates for www subdomain
Browse files Browse the repository at this point in the history
  • Loading branch information
rekby authored Jul 11, 2019
2 parents 060fb91 + 36b7169 commit a06aa4f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/a_main-packr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cmd/static/default-config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ StorageDir = "storage"
StoreJSONMetadata = true

# Directory url of acme server.
#Test server: https://acme-staging-v02.api.letsencrypt.org/directory
#Test server: https://acme-staging.api.letsencrypt.org/directory
AcmeServer = "https://acme-v01.api.letsencrypt.org/directory"

# Include other config files
Expand Down
8 changes: 6 additions & 2 deletions internal/cert_manager/cert-desctiption.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
//nolint:golint
package cert_manager

import "go.uber.org/zap"
import (
"strings"

"go.uber.org/zap"
)

type certNameType string

Expand All @@ -10,7 +14,7 @@ func (n certNameType) String() string {
}

func certNameFromDomain(domain DomainName) certNameType {
return certNameType(domain)
return certNameType(strings.TrimPrefix(domain.String(), "www."))
}

func domainNamesFromCertificateName(name certNameType) []DomainName {
Expand Down

0 comments on commit a06aa4f

Please sign in to comment.