Merge pull request #112 from aykhans/core/refactor-clients

🔧 Update client configs to skip connection verification if it is not secure
This commit is contained in:
Aykhan Shahsuvarov 2025-05-25 19:18:03 +04:00 committed by GitHub
commit dc1cd05714
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 3 deletions

View File

@ -15,7 +15,7 @@ import (
)
const (
VERSION string = "0.6.3"
VERSION string = "0.6.4"
DefaultUserAgent string = "Dodo/" + VERSION
DefaultMethod string = "GET"
DefaultTimeout time.Duration = time.Second * 10

View File

@ -2,6 +2,7 @@ package requests
import (
"context"
"crypto/tls"
"errors"
"math/rand"
"net/url"
@ -39,8 +40,11 @@ func getClients(
}
clients = append(clients, &fasthttp.HostClient{
MaxConns: int(maxConns),
IsTLS: isTLS,
MaxConns: int(maxConns),
IsTLS: isTLS,
TLSConfig: &tls.Config{
InsecureSkipVerify: true,
},
Addr: addr,
Dial: dialFunc,
MaxIdleConnDuration: timeout,
@ -56,6 +60,9 @@ func getClients(
client := &fasthttp.HostClient{
MaxConns: int(maxConns),
IsTLS: isTLS,
TLSConfig: &tls.Config{
InsecureSkipVerify: true,
},
Addr: URL.Host,
MaxIdleConnDuration: timeout,
MaxConnDuration: timeout,