File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import (
1616 "code.gitea.io/gitea/modules/log"
1717 "code.gitea.io/gitea/modules/process"
1818 "code.gitea.io/gitea/modules/setting"
19+ "code.gitea.io/gitea/modules/util"
1920
2021 "github.com/caddyserver/certmagic"
2122)
@@ -68,9 +69,15 @@ func runACME(listenAddr string, m http.Handler) error {
6869 // And one more thing, no idea why we should set the global default variables here
6970 // But it seems that the current ACME code needs these global variables to make renew work.
7071 // Otherwise, "renew" will use incorrect storage path
72+ oldDefaultACME := certmagic .DefaultACME
7173 certmagic .Default .Storage = & certmagic.FileStorage {Path : setting .AcmeLiveDirectory }
7274 certmagic .DefaultACME = certmagic.ACMEIssuer {
73- CA : setting .AcmeURL ,
75+ // try to use the default values provided by DefaultACME
76+ CA : util .IfZero (setting .AcmeURL , oldDefaultACME .CA ),
77+ TestCA : oldDefaultACME .TestCA ,
78+ Logger : oldDefaultACME .Logger ,
79+ HTTPProxy : oldDefaultACME .HTTPProxy ,
80+
7481 TrustedRoots : certPool ,
7582 Email : setting .AcmeEmail ,
7683 Agreed : setting .AcmeTOS ,
You can’t perform that action at this time.
0 commit comments