1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Close #152 add option to skip verification of jira server's certificate chain and hostname

This commit is contained in:
Anand Sudhir Prayaga
2018-06-14 15:59:00 +02:00
parent 2833ec843c
commit 3a519c4910
2 changed files with 14 additions and 1 deletions

View File

@@ -2,6 +2,7 @@ package jira
import (
"bytes"
"crypto/tls"
"encoding/json"
"fmt"
"io"
@@ -59,7 +60,13 @@ func jiraRequest(path string) (*http.Response, error) {
}
req.SetBasicAuth(Config.UString("wtf.mods.jira.email"), os.Getenv("WTF_JIRA_API_KEY"))
httpClient := &http.Client{}
verifyServerCertificate := Config.UBool("wtf.mods.jira.verifyServerCertificate", true)
httpClient := &http.Client{Transport: &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: !verifyServerCertificate,
},
},
}
resp, err := httpClient.Do(req)
if err != nil {
return nil, err