mholt / curl-to-go

Convert curl commands to Go code in your browser

Home Page:https://mholt.github.io/curl-to-go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

curl -k parameter

plutoid opened this issue · comments

hi,

thanks for your work!
when I try this I need curl one self-signed https web, my curl command need -k to ignore security check , after some digging,I add some code , then golang code works, kindly consider this.

same discussion on https://stackoverflow.com/questions/12122159/golang-how-to-do-a-https-request-with-bad-certificate

code like

tr := &http.Transport{
        TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
    }
    client := &http.Client{Transport: tr}
    _, err := client.Get("https://golang.org/")

regards, hua