refactor: workflow condition node
refactor: workflow condition node
This commit is contained in:
@@ -29,6 +29,7 @@ func NewChallengeProvider(config *ChallengeProviderConfig) (challenge.Provider,
|
||||
providerConfig.APIKey = config.ApiKey
|
||||
if config.AllowInsecureConnections {
|
||||
providerConfig.HTTPClient.Transport = &http.Transport{
|
||||
Proxy: http.ProxyFromEnvironment,
|
||||
TLSClientConfig: &tls.Config{
|
||||
InsecureSkipVerify: true,
|
||||
},
|
||||
|
||||
@@ -13,6 +13,7 @@ import (
|
||||
"github.com/luthermonson/go-proxmox"
|
||||
|
||||
"github.com/usual2970/certimate/internal/pkg/core/deployer"
|
||||
httputil "github.com/usual2970/certimate/internal/pkg/utils/http"
|
||||
)
|
||||
|
||||
type DeployerConfig struct {
|
||||
@@ -101,15 +102,16 @@ func createSdkClient(serverUrl, apiToken, apiTokenSecret string, skipTlsVerify b
|
||||
}
|
||||
|
||||
httpClient := &http.Client{
|
||||
Transport: http.DefaultTransport,
|
||||
Transport: httputil.NewDefaultTransport(),
|
||||
Timeout: http.DefaultClient.Timeout,
|
||||
}
|
||||
if skipTlsVerify {
|
||||
httpClient.Transport = &http.Transport{
|
||||
TLSClientConfig: &tls.Config{
|
||||
InsecureSkipVerify: true,
|
||||
},
|
||||
transport := httputil.NewDefaultTransport()
|
||||
if transport.TLSClientConfig == nil {
|
||||
transport.TLSClientConfig = &tls.Config{}
|
||||
}
|
||||
transport.TLSClientConfig.InsecureSkipVerify = true
|
||||
httpClient.Transport = transport
|
||||
}
|
||||
client := proxmox.NewClient(
|
||||
strings.TrimRight(serverUrl, "/")+"/api2/json",
|
||||
|
||||
@@ -65,7 +65,7 @@ func (u *UploaderProvider) Upload(ctx context.Context, certPEM string, privkeyPE
|
||||
}
|
||||
|
||||
// 查询证书列表,避免重复上传
|
||||
// REF: https://www.wangsu.com/document/api-doc/26426
|
||||
// REF: https://www.wangsu.com/document/api-doc/22675?productCode=certificatemanagement
|
||||
listCertificatesResp, err := u.sdkClient.ListCertificates()
|
||||
u.logger.Debug("sdk request 'certificatemanagement.ListCertificates'", slog.Any("response", listCertificatesResp))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user