feat: support proxy settings from env #579

This commit is contained in:
Jacky 2024-10-06 23:17:21 +08:00
parent ecb259a154
commit 390eabf3a0
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
7 changed files with 20 additions and 9 deletions

View file

@ -6,8 +6,8 @@ import (
"crypto/elliptic"
"crypto/rand"
"crypto/tls"
"github.com/0xJacky/Nginx-UI/settings"
"github.com/go-acme/lego/v4/lego"
"github.com/0xJacky/Nginx-UI/settings"
"github.com/go-acme/lego/v4/lego"
"github.com/go-acme/lego/v4/registration"
"math/big"
"net/http"
@ -64,6 +64,7 @@ func (u *AcmeUser) Register() error {
// Skip TLS check
if config.HTTPClient != nil {
config.HTTPClient.Transport = &http.Transport{
Proxy: http.ProxyFromEnvironment,
TLSClientConfig: &tls.Config{InsecureSkipVerify: settings.ServerSettings.InsecureSkipVerify},
}
}