Skip to content

Commit

Permalink
Ignore certificate errors.
Browse files Browse the repository at this point in the history
This is especially needed in cases where intercepting proxies may
be a thing on corporate networks.
  • Loading branch information
leonjza committed Oct 24, 2018
1 parent 944ce30 commit 7cf38a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dnsclient/cloudflare.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dnsclient

import (
"crypto/tls"
"encoding/json"
"io/ioutil"
"log"
Expand All @@ -18,9 +19,13 @@ type CloudflareDNS struct {

// Lookup performs a DNS lookup using Cloudflare
func (c *CloudflareDNS) Lookup(name string, rType uint16) Response {

http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}

client := http.Client{
Timeout: time.Second * 20,
}

req, err := http.NewRequest("GET", c.BaseURL, nil)
if err != nil {
log.Fatal(err)
Expand Down
3 changes: 3 additions & 0 deletions dnsclient/google.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dnsclient

import (
"crypto/tls"
"encoding/json"
"io/ioutil"
"log"
Expand All @@ -19,6 +20,8 @@ type GoogleDNS struct {
// Lookup performs a DNS lookup using Google
func (c *GoogleDNS) Lookup(name string, rType uint16) Response {

http.DefaultTransport.(*http.Transport).TLSClientConfig = &tls.Config{InsecureSkipVerify: true}

client := http.Client{
Timeout: time.Second * 20,
}
Expand Down

0 comments on commit 7cf38a8

Please sign in to comment.