1. server gave HTTP response to HTTPS client
出现场景,http包get请求https的
原代码
bash
response, err := http.Get(fmt.Sprintf("https://%v/api/user/secret/?name=%v&password=%v", djang_ip, username, password))
修改后
有地方说go的版本问题,我采用屏蔽掉证书校验,将https改为http
bash
http.DefaultClient.Transport = &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true,
},
}
response, err := http.Get(fmt.Sprintf("http://%v/api/user/secret/?name=%v&password=%v", djang_ip, username, password))