mirror of
https://github.com/aykhans/dodo.git
synced 2025-05-30 03:10:03 +00:00
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:
commit
dc1cd05714
@ -15,7 +15,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
VERSION string = "0.6.3"
|
VERSION string = "0.6.4"
|
||||||
DefaultUserAgent string = "Dodo/" + VERSION
|
DefaultUserAgent string = "Dodo/" + VERSION
|
||||||
DefaultMethod string = "GET"
|
DefaultMethod string = "GET"
|
||||||
DefaultTimeout time.Duration = time.Second * 10
|
DefaultTimeout time.Duration = time.Second * 10
|
||||||
|
@ -2,6 +2,7 @@ package requests
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"crypto/tls"
|
||||||
"errors"
|
"errors"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"net/url"
|
"net/url"
|
||||||
@ -39,8 +40,11 @@ func getClients(
|
|||||||
}
|
}
|
||||||
|
|
||||||
clients = append(clients, &fasthttp.HostClient{
|
clients = append(clients, &fasthttp.HostClient{
|
||||||
MaxConns: int(maxConns),
|
MaxConns: int(maxConns),
|
||||||
IsTLS: isTLS,
|
IsTLS: isTLS,
|
||||||
|
TLSConfig: &tls.Config{
|
||||||
|
InsecureSkipVerify: true,
|
||||||
|
},
|
||||||
Addr: addr,
|
Addr: addr,
|
||||||
Dial: dialFunc,
|
Dial: dialFunc,
|
||||||
MaxIdleConnDuration: timeout,
|
MaxIdleConnDuration: timeout,
|
||||||
@ -56,6 +60,9 @@ func getClients(
|
|||||||
client := &fasthttp.HostClient{
|
client := &fasthttp.HostClient{
|
||||||
MaxConns: int(maxConns),
|
MaxConns: int(maxConns),
|
||||||
IsTLS: isTLS,
|
IsTLS: isTLS,
|
||||||
|
TLSConfig: &tls.Config{
|
||||||
|
InsecureSkipVerify: true,
|
||||||
|
},
|
||||||
Addr: URL.Host,
|
Addr: URL.Host,
|
||||||
MaxIdleConnDuration: timeout,
|
MaxIdleConnDuration: timeout,
|
||||||
MaxConnDuration: timeout,
|
MaxConnDuration: timeout,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user