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 ...
随机推荐
- LeeCode——Second Highest Salary
Write a SQL query to get the second highest salary from the Employee table. +----+--------+ | Id | S ...
- 静态文件 static
一.常见的形式 前面初步搭建Django开局时候就 在 项目路径下 建立了statics 文件夹,然后在 settings.py 文件的末尾添加了 statics 文件夹的绝对路径. # 这个可以给 ...
- 0.Jenkins 介绍
一.持续集成的概念 continuous intergaration (简称CI),持续集成. 持续集成是一种软件开发实践,即团队开发成员经常集成他们的工作,通常每个成员每天至少集成一次,也就意味 ...
- 201871020225-牟星源《面向对象程序设计(java)》第十五周学习总结
201871020225-牟星源<面向对象程序设计(java)>第十五周学习总结 项目 内容 这个作业属于哪个课程 https://www.cnblogs.com/nwnu-daizh/ ...
- pip安装指定版本的程序的命令
pip安装指定版本的程序的命令 pip install -i https://pypi.douban.com/simple/ django==1.10.3 或者 pip install django= ...
- OpenCV随机颜色,用于画图调试
static Scalar randomColor(int64 seed) { RNG rng(seed); int icolor = (unsigned)rng; return Scalar(ico ...
- js中,null, '',undefined的区别
在js中有三种值都可以代表false "",null,undefined 那么他们之间到底有什么区别呢 首先我们先看这三种值得类型 ""代表了一个没有字符的字 ...
- Python-numpy包中多维数组转置,transpose.swapaxes的轴编号(axis)的理解
transpose()中三个轴编号的位置变化理解 transpose(a,b,c)其中a轴编号即为参考编号,垂直于a的平面即为所有平面,该平面上的数据再根据b,c相对于(0,1,2)的位置关系进行改变 ...
- 基于OpenVINO的多输入model optimizer(Tensorflow)
Step I:下载预训练模型 wget -O - https://github.com/mozilla/DeepSpeech/releases/download/v0.3.0/deepspeech-0 ...
- SQL Server的字符类型
Tip1. Char/Varcahr均为非Unicode字符,意味着放非英文字符放进去会需要进行编译,将来可能会出现问题,如果这个字段将来可能要输入中文韩文日文等,建议用Nchar或Nvarchar. ...