Fixed dpcore TLSClientConfig is nil bug

This commit is contained in:
Toby Chui 2025-03-02 09:12:29 +08:00
parent 75c351e7e2
commit fd41a1cb91

View File

@ -2,6 +2,7 @@ package dpcore
import (
"context"
"crypto/tls"
"errors"
"io"
"log"
@ -130,6 +131,9 @@ func NewDynamicProxyCore(target *url.URL, prepender string, dpcOptions *DpcoreOp
if dpcOptions.IgnoreTLSVerification {
//Ignore TLS certificate validation error
if thisTransporter.(*http.Transport).TLSClientConfig == nil {
thisTransporter.(*http.Transport).TLSClientConfig = &tls.Config{}
}
thisTransporter.(*http.Transport).TLSClientConfig.InsecureSkipVerify = true
}