mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-25 17:30:36 +00:00
This commit is contained in:
parent
df72cf6211
commit
e2f39c2b64
1 changed files with 6 additions and 1 deletions
|
@ -24,10 +24,14 @@ func runLetsEncrypt(listenAddr, domain, directory, email string, m http.Handler)
|
||||||
enableHTTPChallenge := true
|
enableHTTPChallenge := true
|
||||||
enableTLSALPNChallenge := true
|
enableTLSALPNChallenge := true
|
||||||
altHTTPPort := 0
|
altHTTPPort := 0
|
||||||
|
altTLSALPNPort := 0
|
||||||
|
|
||||||
if p, err := strconv.Atoi(setting.PortToRedirect); err == nil {
|
if p, err := strconv.Atoi(setting.PortToRedirect); err == nil {
|
||||||
altHTTPPort = p
|
altHTTPPort = p
|
||||||
}
|
}
|
||||||
|
if p, err := strconv.Atoi(setting.HTTPPort); err == nil {
|
||||||
|
altTLSALPNPort = p
|
||||||
|
}
|
||||||
|
|
||||||
magic := certmagic.NewDefault()
|
magic := certmagic.NewDefault()
|
||||||
magic.Storage = &certmagic.FileStorage{Path: directory}
|
magic.Storage = &certmagic.FileStorage{Path: directory}
|
||||||
|
@ -36,7 +40,8 @@ func runLetsEncrypt(listenAddr, domain, directory, email string, m http.Handler)
|
||||||
Agreed: setting.LetsEncryptTOS,
|
Agreed: setting.LetsEncryptTOS,
|
||||||
DisableHTTPChallenge: !enableHTTPChallenge,
|
DisableHTTPChallenge: !enableHTTPChallenge,
|
||||||
DisableTLSALPNChallenge: !enableTLSALPNChallenge,
|
DisableTLSALPNChallenge: !enableTLSALPNChallenge,
|
||||||
ListenHost: listenAddr,
|
ListenHost: setting.HTTPAddr,
|
||||||
|
AltTLSALPNPort: altTLSALPNPort,
|
||||||
AltHTTPPort: altHTTPPort,
|
AltHTTPPort: altHTTPPort,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue