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:
parent
2833ec843c
commit
3a519c4910
@ -43,6 +43,7 @@ jira:
|
||||
project: "JIRA"
|
||||
refreshInterval: 900
|
||||
username: "chris.cummer"
|
||||
verifyServerCertificate: true
|
||||
```
|
||||
|
||||
### Attributes
|
||||
@ -86,3 +87,8 @@ Values: A positive integer, `0..n`.
|
||||
|
||||
`username` <br />
|
||||
Your Jira username. <br />
|
||||
|
||||
`verifyServerCertificate` <br />
|
||||
_Optional_ <br />
|
||||
Determines whether or not the server's certificate chain and host name are verified. <br />
|
||||
Values: `true`, `false`.
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user