diff --git a/_site/content/posts/modules/jira.md b/_site/content/posts/modules/jira.md index 08479c62d..d1cf2752a 100644 --- a/_site/content/posts/modules/jira.md +++ b/_site/content/posts/modules/jira.md @@ -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`
Your Jira username.
+ +`verifyServerCertificate`
+_Optional_
+Determines whether or not the server's certificate chain and host name are verified.
+Values: `true`, `false`. diff --git a/jira/client.go b/jira/client.go index b7903018d..ca03152e4 100644 --- a/jira/client.go +++ b/jira/client.go @@ -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