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