mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-06 02:36:49 +00:00
deactivate TLS check for client call
This commit is contained in:
parent
aff18b2b12
commit
8acffdf9b2
1 changed files with 7 additions and 3 deletions
|
|
@ -2,6 +2,7 @@ package pdf
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/tls"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"io"
|
||||
|
|
@ -129,17 +130,20 @@ func (ps PdfService) BuildReport(r *booking.Report, period string, month, year i
|
|||
func (ps PdfService) sendData(payload []byte) error {
|
||||
req, err := http.NewRequest("POST", ps.url, bytes.NewBuffer(payload))
|
||||
if err != nil {
|
||||
log.Warnf("Error creating request:", err)
|
||||
log.Warnf("Error creating request: %s", err)
|
||||
return err
|
||||
}
|
||||
|
||||
req.Header.Set("Authorization", "Bearer "+ps.apiKey)
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
|
||||
client := &http.Client{}
|
||||
t := &http.Transport{
|
||||
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
|
||||
}
|
||||
client := &http.Client{Transport: t}
|
||||
resp, err := client.Do(req)
|
||||
if err != nil {
|
||||
log.Warnf("Error sending request:", err)
|
||||
log.Warnf("Error sending request: %s", err)
|
||||
return err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
|
|
|
|||
Loading…
Reference in a new issue