Don't change port when TLS is managed manually

This commit is contained in:
Matthew Holt 2016-06-28 18:16:10 -06:00
parent 345ece3850
commit 5a45719227
No known key found for this signature in database
GPG key ID: 0D97CC73664F4D03

View file

@ -138,7 +138,7 @@ func (h *httpContext) MakeServers() ([]caddy.Server, error) {
// is incorrect for this site. // is incorrect for this site.
cfg.Addr.Scheme = "https" cfg.Addr.Scheme = "https"
} }
if cfg.Addr.Port == "" { if cfg.Addr.Port == "" && (!cfg.TLS.Manual || cfg.TLS.OnDemand) {
// this is vital, otherwise the function call below that // this is vital, otherwise the function call below that
// sets the listener address will use the default port // sets the listener address will use the default port
// instead of 443 because it doesn't know about TLS. // instead of 443 because it doesn't know about TLS.