set TLS to version 1.2
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
package api
|
package api
|
||||||
|
|
||||||
import "resty.dev/v3"
|
import (
|
||||||
|
"crypto/tls"
|
||||||
|
|
||||||
|
"resty.dev/v3"
|
||||||
|
)
|
||||||
|
|
||||||
type Client struct {
|
type Client struct {
|
||||||
token string
|
token string
|
||||||
@@ -20,11 +24,17 @@ func NewClient(token string) *Client {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewDMClient(token, dmURL, device string) *Client {
|
func NewDMClient(token, dmURL, device string) *Client {
|
||||||
|
restyClient := resty.New()
|
||||||
|
restyClient.SetTLSClientConfig(&tls.Config{
|
||||||
|
MinVersion: tls.VersionTLS12,
|
||||||
|
MaxVersion: tls.VersionTLS12,
|
||||||
|
})
|
||||||
|
|
||||||
return &Client{
|
return &Client{
|
||||||
token: token,
|
token: token,
|
||||||
device: device,
|
device: device,
|
||||||
resty: resty.New(),
|
resty: restyClient,
|
||||||
apiBaseURL: dmURL,
|
apiBaseURL: dmURL,
|
||||||
fiscalEndpoint: "/dm/execute",
|
fiscalEndpoint: "/dm/fiscal",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user