set TLS to version 1.2

This commit is contained in:
2026-01-16 02:14:31 +03:00
parent 81fb8c7e7e
commit 961b90626f

View File

@@ -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",
} }
} }