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))
	
相关推荐
追逐时光者4 小时前
一个致力于为 C# 程序员提供更佳的编码体验和效率的 Visual Studio 扩展插件
后端·c#·visual studio
molaifeng5 小时前
Go 语言如何实现高性能网络 I/O:Netpoller 模型揭秘
开发语言·网络·golang
崇山峻岭之间6 小时前
Matlab学习记录33
开发语言·学习·matlab
Evand J6 小时前
【2026课题推荐】DOA定位——MUSIC算法进行多传感器协同目标定位。附MATLAB例程运行结果
开发语言·算法·matlab
行百里er6 小时前
用 ThreadLocal + Deque 打造一个“线程专属的调用栈” —— Spring Insight 的上下文管理术
java·后端·架构
jllllyuz6 小时前
基于MATLAB的二维波场模拟程序(含PML边界条件)
开发语言·matlab
忆锦紫6 小时前
图像增强算法:Gamma映射算法及MATLAB实现
开发语言·算法·matlab
玄〤6 小时前
黑马点评中 VoucherOrderServiceImpl 实现类中的一人一单实现解析(单机部署)
java·数据库·redis·笔记·后端·mybatis·springboot
J_liaty7 小时前
Spring Boot拦截器与过滤器深度解析
java·spring boot·后端·interceptor·filter
短剑重铸之日7 小时前
《7天学会Redis》Day2 - 深入Redis数据结构与底层实现
数据结构·数据库·redis·后端