Skip to content

Commit dc1cd05

Browse files
authored
Merge pull request #112 from aykhans/core/refactor-clients
🔧 Update client configs to skip connection verification if it is not secure
2 parents bea2e7c + 2b9d052 commit dc1cd05

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
)
1616

1717
const (
18-
VERSION string = "0.6.3"
18+
VERSION string = "0.6.4"
1919
DefaultUserAgent string = "Dodo/" + VERSION
2020
DefaultMethod string = "GET"
2121
DefaultTimeout time.Duration = time.Second * 10

requests/client.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package requests
22

33
import (
44
"context"
5+
"crypto/tls"
56
"errors"
67
"math/rand"
78
"net/url"
@@ -39,8 +40,11 @@ func getClients(
3940
}
4041

4142
clients = append(clients, &fasthttp.HostClient{
42-
MaxConns: int(maxConns),
43-
IsTLS: isTLS,
43+
MaxConns: int(maxConns),
44+
IsTLS: isTLS,
45+
TLSConfig: &tls.Config{
46+
InsecureSkipVerify: true,
47+
},
4448
Addr: addr,
4549
Dial: dialFunc,
4650
MaxIdleConnDuration: timeout,
@@ -56,6 +60,9 @@ func getClients(
5660
client := &fasthttp.HostClient{
5761
MaxConns: int(maxConns),
5862
IsTLS: isTLS,
63+
TLSConfig: &tls.Config{
64+
InsecureSkipVerify: true,
65+
},
5966
Addr: URL.Host,
6067
MaxIdleConnDuration: timeout,
6168
MaxConnDuration: timeout,

0 commit comments

Comments
 (0)