File tree 1 file changed +8
-1
lines changed 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import (
16
16
"code.gitea.io/gitea/modules/log"
17
17
"code.gitea.io/gitea/modules/process"
18
18
"code.gitea.io/gitea/modules/setting"
19
+ "code.gitea.io/gitea/modules/util"
19
20
20
21
"github.com/caddyserver/certmagic"
21
22
)
@@ -68,9 +69,15 @@ func runACME(listenAddr string, m http.Handler) error {
68
69
// And one more thing, no idea why we should set the global default variables here
69
70
// But it seems that the current ACME code needs these global variables to make renew work.
70
71
// Otherwise, "renew" will use incorrect storage path
72
+ oldDefaultACME := certmagic .DefaultACME
71
73
certmagic .Default .Storage = & certmagic.FileStorage {Path : setting .AcmeLiveDirectory }
72
74
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
+
74
81
TrustedRoots : certPool ,
75
82
Email : setting .AcmeEmail ,
76
83
Agreed : setting .AcmeTOS ,
You can’t perform that action at this time.
0 commit comments