NetCore HttpClient The SSL connection could not be established, see inner exception
之前遇到一个问题
https://www.cnblogs.com/leoxjy/p/10201046.html
在centos 7.x HttpClient访问会出问题 The SSL connection could not be established, see inner exception
最后彻底解决是进入容器docker
那么 最近又翻墙搜到一个解决方案 可以systemctl 运行的时候也不会 SSL
上代码
var httpClientHandler = new HttpClientHandler
{
ServerCertificateCustomValidationCallback = (message, certificate2, arg3, arg4) => true
};
using (HttpClient client = new HttpClient(httpClientHandler))
{
string url = WeiXinSettings.GetJscode2Session(code); var result = await client.GetAsync(url); if (result.IsSuccessStatusCode)
{
string str = await result.Content.ReadAsStringAsync(); return str;
}
}
解决办法2
修改centos的环境变量 DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0
解决办法3
通过在netcore. runtimeconfig.template.json配置文件中定义 System.Net.Http.UseSocketsHttpHandler 开关:
"runtimeOptions": {
"configProperties": {
"System.Net.Http.UseSocketsHttpHandler": false
}
}
NetCore HttpClient The SSL connection could not be established, see inner exception的更多相关文章
- The request with exception: The SSL connection could not be established, see inner exception. requestId 解决方案
DOTNET CORE 部署 Centos7 抛出异常 环境变量如下: .NET Core SDK (reflecting any global.json): Version: 2.2.401 Com ...
- powercli The SSL connection could not be established, see inner exception. 问题解决
Connect-VIServer -Server 这里是"SSL连接不能建立......"这实际上意味着你没有一个有效的证书.如果你想连接到vCenter没有一个有效的证书,您必须 ...
- HttpClient SSL connection could not be established error
系统从.net framework 升级到dotnet core2.1 原先工作正常的httpclient,会报SSL connection could not be established erro ...
- 记一个netcore HttpClient的坑
异常信息 The SSL connection could not be established, see inner exception ---> AuthenticationExceptio ...
- Could not create SSL connection through proxy serve-svn
RA layer request failedsvn: Unable to connect to a repository at URL xxxxxx 最后:Could not create SSL ...
- MySQL 警告WARN: Establishing SSL connection without server's identity verification is not recommended.解决办法
Fri Jun 17 13:46:54 CST 2016 WARN: Establishing SSL connection without server's identity verificatio ...
- WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default i
jdbc连接数据库候,对数据进行访问,访问正常当出现如下警告: WARN: Establishing SSL connection without server's identity verifica ...
- C3P0 WARN: Establishing SSL connection without server's identity verification is not recommended
c3p0的出现,是为了大大提高应用程序和数据库之间访问效率的. 它的特性: 编码的简单易用 连接的复用 连接的管理 今天在配置C3p0的时候出现了这个warn 原因是因为要验证SSL Wed Se ...
- Java连接mysql——Establishing SSL connection without server's identity verification is not recommended.
Establishing SSL connection without server's identity verification is not recommended. 出现这个错误的原因是因为m ...
随机推荐
- Web Service 接口测试
Web Service 接口测试 Web service 概念 Web service使用与平台和编程语言无关的方式进行通讯的一项技术, web service 是一个接口, 他描述了一组可以在网络上 ...
- failed to map segment from shared object: Permission denied(error while loading shared libraries: libz.so.1)
centos 6.3 服务器重启后,sshd 竟然连接不上了,防火墙也没有限制,重启sshd 服务报以下错误: 于是到/lib64 目录下找,库文件并没有少,仔细想后面的报错信息是权限被拒绝了,百度了 ...
- SQL SERVER 用户自定义函数(UDF)深入解析
本文内容概要: UDF 概念.原理.优缺点.UDF 的分类 详细讲述3种 UDF 的创建.调用方法以及注意事项 UDF 的实践建议 基本原理: UDF:user-defined functions,用 ...
- vue router 导航守卫生命周期
导航守卫 导航守卫主要用来通过跳转或取消的方式守卫导航.有多种机会植入路由导航过程中:全局的, 单个路由独享的, 或者组件级的.(记住参数或查询的改变并不会触发进入/离开的导航守卫.你可以通过观察$r ...
- appium 基础:常用api接口(2)
一.获取手机分辨率 size=driver.get_window_size()#获取手机屏幕大小,分辨率 print(size)#{'width': 720, 'height': 1280} 得到的是 ...
- 跟着ALEX 学python day3集合 文件操作 函数和函数式编程 内置函数
声明 : 文档内容学习于 http://www.cnblogs.com/xiaozhiqi/ 一. 集合 集合是一个无序的,不重复的数据组合,主要作用如下 1.去重 把一个列表变成集合 ,就自动去重 ...
- 201871010132--张潇潇--《面向对象程序设计(java)》第十二周学习总结
博文正文开头格式:(2分) 项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ 这个作业的要求在哪里 https://www.cnblogs.co ...
- Vi编辑网卡
Vi /etc/sysconfig/network-scripts/ifcfg-ens33 1.光标定位到BOOTPROTO=后面 2.然后按x键进行删除 3.按i键打开编辑模式,输入BOOTPRO ...
- 03-numpy-笔记-expand_dims
>>> x = np.array([[1,2,3],[4,5,6]]) >>> x.shape (2, 3) >>> np.expand_dims ...
- django之视图层和部分模板层
视图层 小白必会三板斧(三个返回的都是HttpResponse对象,通过看源码,可以知道是内部实现) 1.HttpResponse # 返回字符串 2.render # 返回一个html页面 还可以给 ...