之前遇到一个问题

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. Android培训准备资料之Android开发环境的搭建

    Android开发环境的搭建主要分为以下四步: (1)下载JDK并安装 (2)配置JDK环境变量 (3)下载安装Android Studio (4)配置Android SDK环境变量(可执行可不执行) ...

  2. PMP备考-第三章-项目管理过程

    过程:完成预定目标的,一系列相互关联的活动的集合,以便运用一些列工具与技术把特定的输入转化成特定的输出. 五大项目管理过程组:启动-规划-执行-监控-收尾 戴明环(PDCA循环):计划-实施-检查-行 ...

  3. 汇编指令之JMP,CALL,RET(修改EIP的值!!!)

    简单介绍了,JMP指令按市面上的意思来说是跳转到指定地址,但我这里不这么说,JMP, CALL, RET三个指令均为修改EIP值的指令,EAX, ECX, EBX, EDX, ESP, EBP, ES ...

  4. 使用ES对中文文章进行分词,并进行词频统计排序

    前言:首先有这样一个需求,需要统计一篇10000字的文章,需要统计里面哪些词出现的频率比较高,这里面比较重要的是如何对文章中的一段话进行分词,例如“北京是×××的首都”,“北京”,“×××”,“中华” ...

  5. [linux] 进程五状态模型

    运行态:该进程正在执行:就绪态:进程做好了准备,只要有机会就开始执行:阻塞态:进程在某些事件发生前不能执行,如I/O 操作完成:新建态:刚刚创建的进程,操作系统还没有把它加入到可执行进程组中.通常是进 ...

  6. input子系统四 input事件处理【转】

    转自:https://blog.csdn.net/qwaszx523/article/details/54139897 转自http://blog.csdn.net/coldsnow33/articl ...

  7. node知识

    node中的url url中的方法: parse,resolve,format: 方法parse: 例子:url.parse('http://imooc.com/course/list'); 结果:{ ...

  8. Sentinel Dashboard 的 Docker 镜像使用

    1.下载 docker 镜像:https://hub.docker.com/r/anjia0532/sentinel-docker 2.启动 docker 容器:docker run -p8080:8 ...

  9. 莫烦TensorFlow_01 基本程序结构

    import tensorflow as tf import numpy as np # create data x_data = np.random.rand(100).astype(np.floa ...

  10. koa中的路由

    原生路由 网站一般都有多个页面.通过ctx.request.path可以获取用户请求的路径,由此实现简单的路由. const main = ctx => { if (ctx.request.pa ...