Skip to content

Commit

Permalink
adding skip verify for upstream proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
Mzack9999 committed Dec 24, 2020
1 parent a338593 commit 72986a3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package proxify
import (
"bufio"
"bytes"
"crypto/tls"
"io/ioutil"
"log"
"net/http"
Expand Down Expand Up @@ -189,14 +190,14 @@ func (p *Proxy) Run() error {
if p.options.UpstreamHTTPProxy != "" {
p.httpproxy.Tr = &http.Transport{Proxy: func(req *http.Request) (*url.URL, error) {
return url.Parse(p.options.UpstreamHTTPProxy)
}}
}, TLSClientConfig: &tls.Config{InsecureSkipVerify: true}}
p.httpproxy.ConnectDial = p.httpproxy.NewConnectDialToProxy(p.options.UpstreamHTTPProxy)
} else if p.options.UpstreamSock5Proxy != "" {
dialer, err := proxy.SOCKS5("tcp", p.options.UpstreamSock5Proxy, nil, proxy.Direct)
if err != nil {
return err
}
p.httpproxy.Tr = &http.Transport{Dial: dialer.Dial}
p.httpproxy.Tr = &http.Transport{Dial: dialer.Dial, TLSClientConfig: &tls.Config{InsecureSkipVerify: true}}
p.httpproxy.ConnectDial = nil
} else {
p.httpproxy.Tr.DialContext = p.Dialer.Dial
Expand Down

0 comments on commit 72986a3

Please sign in to comment.