Skip to content

Commit

Permalink
Merge pull request #6 from OSSystems/development
Browse files Browse the repository at this point in the history
coap: skip tls verify
  • Loading branch information
gustavosbarreto authored Feb 25, 2019
2 parents b181656 + c7be1a1 commit 9771792
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion coap.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"crypto/tls"
"io/ioutil"
"net"
"net/http"
Expand All @@ -20,7 +21,15 @@ const (

func doHTTPRequest(req *http.Request) (*http.Response, []byte, error) {
timeout := defaultHTTPTimeout
httpClient := &http.Client{Timeout: timeout}

tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}

httpClient := &http.Client{
Timeout: timeout,
Transport: tr,
}

httpResp, err := httpClient.Do(req)
if err != nil {
Expand Down

0 comments on commit 9771792

Please sign in to comment.