Skip to content

Commit

Permalink
Allow on demand cert creation for root domain. Closes #287.
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniomika committed May 28, 2024
1 parent f381389 commit b59cd1e
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions httpmuxer/httpmuxer.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,16 +365,18 @@ func Start(state *utils.State) {
return fmt.Errorf("ondemand certificate retrieval is not enabled")
}

ok := false
ok := name == viper.GetString("domain")

state.HTTPListeners.Range(func(key string, locationListener *utils.HTTPHolder) bool {
if name == locationListener.HTTPUrl.Host || utils.MatchesWildcardHost(name, locationListener.HTTPUrl.Host) {
ok = true
return false
}
if !ok {
state.HTTPListeners.Range(func(key string, locationListener *utils.HTTPHolder) bool {
if name == locationListener.HTTPUrl.Host || utils.MatchesWildcardHost(name, locationListener.HTTPUrl.Host) {
ok = true
return false
}

return true
})
return true
})
}

if !ok {
return fmt.Errorf("cannot find connection for host: %s", name)
Expand Down

0 comments on commit b59cd1e

Please sign in to comment.