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))
	
相关推荐
旖旎夜光几秒前
【C 语言】(二)模拟实现 strlen、strcpy、strcmp、strstr、memcpy、memmove
c语言·开发语言·笔记·学习
用户47949283569159 分钟前
2026 流程图与架构图工具选型对比:draw.io、ProcessOn、Mermaid、Excalidraw、Archify 分别适合谁?
前端·后端·agent
codeejun1 小时前
每日一Go·MySQL-22、幻读、不可重复读、脏读实战演示
开发语言·mysql·golang
云草桑1 小时前
C#入坑JAVA 潜规则 API Get 多参数 Spring Boot与Spring Cloud 区别 入门系列4
java·开发语言
码途行者10 小时前
每天10分钟学Go:第17课 接口interface-只规定“能做什么“,不管它是什么
开发语言·后端·golang
头发还在的女程序员10 小时前
Java充电桩平台源码解析:枪口状态、上报时间与页面刷新怎样协同
java·开发语言·充电桩系统·充电桩管理·充电系统·充电小程序
timeDifference₇11 小时前
Python Vibe Coding实操实验报告
开发语言·jvm·python
geovindu12 小时前
python:DecisionTree
开发语言·后端·python·算法
Cosolar12 小时前
从 Java 21 升到 25、Spring Boot 3 升 4:一次可复现的迁移踩坑实录
java·后端·面试
geovindu14 小时前
python: Decision Tree Regressor
开发语言·后端·python·算法·决策树