golang踩坑记录

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))
	
相关推荐
Escalating_xu6 分钟前
【C++类和对象(上)】从类的定义、封装与对象模型到内存对齐和 this 指针
开发语言·前端·c++
阿里嘎多学长10 分钟前
2026-08-30 GitHub 热点项目精选
开发语言·程序员·github·代码托管
运维开发笔记14 分钟前
8.1 Go Struct 结构体基础
golang
默辨14 分钟前
我用Java后端的视角读了一遍JoyAgent-JDGenie
java·开发语言
常山云栈15 分钟前
如何理解python中的鸭子模(类)型?
开发语言·python
y = xⁿ19 分钟前
DeepSeek harness工具系统什么设计的?
开发语言·python
luj_176824 分钟前
尾椎藏今生记忆?骨盆对应不确定性
开发语言·网络·c++·经验分享·算法
ttwuai28 分钟前
Go 后台接入 CAS 单点登录后,原来的权限怎么继续生效?
开发语言·后端·golang
断点之下35 分钟前
C++类和对象:六个默认成员函数详解
开发语言·c++