New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net/http: Post fails with x509: certificate signed by unknown authority #9586
Comments
This is too little information. Please show the code to demonstrate the problem. |
There are similar code package main import ( "crypto/tls" "fmt" "io/ioutil" "net/http" "net/http/cookiejar" "net/url" "strings" ) func init() { cfg := &tls.Config{ InsecureSkipVerify: true, } http.DefaultClient.Transport = &http.Transport{ TLSClientConfig: cfg, } } func httpPostForm() { parm := url.Values{} parm.Add("username", "***") parm.Add("passwd", "***") cookieJar, _ := cookiejar.New(nil) client := &http.Client{ Jar: cookieJar, } req, err := http.NewRequest("POST", "https://www.gjsq.biz/index.php", strings.NewReader(parm.Encode())) req.Header.Add("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36") req.Header.Set("Content-Type", "application/x-www-form-urlencoded") resp, err := client.Do(req) if err != nil { fmt.Printf("%s", err) } defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil { fmt.Printf("%s", err) } fmt.Println(string(body)) } func main() { httpPostForm(); } |
It looks like one of the signatories in the path are not known/trusted by Ubuntu (nor my mac as it turns out). This appears to be a common problem with RapidSSL certs. Closing: invalid. Sorry, this isn't a Go bug. |
Actually, the real problem is that the server (www.gjsq.biz:443) fails to A real chain (which is trusted) should look like this: Because GeoTrust Global CA root CA should really be included in all major The conclusion is the same. It's not Go's problem. Perhaps the OP should |
The same code running under Windows without problems, but under debian, POST has problems, GET is no problem.
InsecureSkipVerify: true
Golang version 1.4
The text was updated successfully, but these errors were encountered: