之前遇到一个问题

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的更多相关文章

  1. 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 ...

  2. powercli The SSL connection could not be established, see inner exception. 问题解决

    Connect-VIServer -Server 这里是"SSL连接不能建立......"这实际上意味着你没有一个有效的证书.如果你想连接到vCenter没有一个有效的证书,您必须 ...

  3. HttpClient SSL connection could not be established error

    系统从.net framework 升级到dotnet core2.1 原先工作正常的httpclient,会报SSL connection could not be established erro ...

  4. 记一个netcore HttpClient的坑

    异常信息 The SSL connection could not be established, see inner exception ---> AuthenticationExceptio ...

  5. 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 ...

  6. 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 ...

  7. 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 ...

  8. C3P0 WARN: Establishing SSL connection without server's identity verification is not recommended

    c3p0的出现,是为了大大提高应用程序和数据库之间访问效率的. 它的特性: 编码的简单易用 连接的复用 连接的管理 今天在配置C3p0的时候出现了这个warn   原因是因为要验证SSL Wed Se ...

  9. 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 ...

随机推荐

  1. Git 合并单个文件

    有两个分支 # git branch -a * branchA branchB remotes/origin/branchC A分支合并B分支单个文件 注意是本地分支,还是远程分支 # git che ...

  2. Ansible配置执行远程主机的ssh端口号

    在线上的环境中,服务端的ssh会有进行变更的情况 例如:有些服务器的ssh端口号是 34567 等情况,那么该如何配置呢? 编辑 /etc/ansible/hosts [servers] 配置完毕后, ...

  3. odoo10学习笔记十七:controller

    转载请注明原文地址:https://www.cnblogs.com/ygj0930/p/11189391.html 一:controller简述 odoo里面的controller相似于springM ...

  4. nyoj 1278G: Prototypes analyze 与 二叉排序树(BST)模板

    参考博客:https://blog.csdn.net/stpeace/article/details/9067029 参考博客:https://blog.csdn.net/baidu_35643793 ...

  5. Spring(004)-Bean装配

    一,问题,Bean找不到 代码 @Component public class DemoClass { public int doSth() { ; } } 测试代码 @RunWith(SpringJ ...

  6. 添加ssh密钥

    直接运行ssh-keygen,可以不输入密码 $ ssh-keygen Generating public/private rsa key pair. Enter file in which to s ...

  7. Python学习笔记6 函数式编程_20170619

    廖雪峰python3学习笔记: # 高阶函数 将函数作为参数传入,这样的函数就是高阶函数(有点像C++的函数指针) def add(x, y): return x+y def mins(x, y): ...

  8. 安卓Jsoup爬虫

    第一步:导入Jsoup包:把你的jar包放在libs下面之后 接着就会显示在你的这个地方: 重要的还是源码(搞了很久 出错很多 终于成功):我做的是输入要查找的关键字百度百科爬取主要定义,按照标签爬取 ...

  9. 2.第一个Vue程序

    1.IDEA中安装Vue.js插件 2.建立项目以及html文件 1.创建一个 HTML 文件 2.引入 Vue.js <script src="https://cdn.jsdeliv ...

  10. ASP.NET开发实战——(一)开篇-用VS创建一个ASP.NET Web程序

        本文是本系列文章第一篇,主要通过建立一个默认ASP.NET MVC项目来引出与ASP.NET MVC相关的功能,由于ASP.NET MVC一个简单的模板就具备了数据库操作.身份验证.输入数据校 ...