mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-06 10:00:24 +08:00
测试环境下申请ACME证书时打印调试日志
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
|||||||
"github.com/go-acme/lego/v4/lego"
|
"github.com/go-acme/lego/v4/lego"
|
||||||
acmelog "github.com/go-acme/lego/v4/log"
|
acmelog "github.com/go-acme/lego/v4/log"
|
||||||
"github.com/go-acme/lego/v4/registration"
|
"github.com/go-acme/lego/v4/registration"
|
||||||
|
"github.com/iwind/TeaGo/Tea"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
)
|
)
|
||||||
@@ -139,8 +140,10 @@ func (this *Request) runDNS() (certData []byte, keyData []byte, err error) {
|
|||||||
|
|
||||||
func (this *Request) runHTTP() (certData []byte, keyData []byte, err error) {
|
func (this *Request) runHTTP() (certData []byte, keyData []byte, err error) {
|
||||||
if !this.debug {
|
if !this.debug {
|
||||||
|
if !Tea.IsTesting() {
|
||||||
acmelog.Logger = log.New(io.Discard, "", log.LstdFlags)
|
acmelog.Logger = log.New(io.Discard, "", log.LstdFlags)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if this.task.User == nil {
|
if this.task.User == nil {
|
||||||
err = errors.New("'user' must not be nil")
|
err = errors.New("'user' must not be nil")
|
||||||
|
|||||||
Reference in New Issue
Block a user