HttpClient SSL connection could not be established error
系统从.net framework 升级到dotnet core2.1
原先工作正常的httpclient,会报SSL connection could not be established error 错误
在.net framework中通过ServicePointManager,当证书出错时,可以跳过证书验证。
ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true
升级到dotnet core 2.1后,发现以上配置无效。
原因是ServicePointManager只对HttpWebRequest有效,.net framework中httpclient是基于HttpWebRequest实现的,所以Httpclient不会报错
在dotnetcore2.1中,Httpclient想要实现相同的功能,需要在HttpClient中设置。
var handler = new HttpClientHandler
{
ServerCertificateCustomValidationCallback = delegate { return true; }
};
github上有人提过这个问题,可以参见 https://github.com/dotnet/corefx/issues/29452
HttpClient SSL connection could not be established error的更多相关文章
- 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 conne ...
- 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没有一个有效的证书,您必须 ...
- mysql连接error,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 .....
完整error Establishing SSL connection without server's identity verification is not recommended. Accor ...
- 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 ...
- Java连接Mysql数据库警告: 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
详细错误: Establishing SSL connection without server's identity verification is not recommended. Accordi ...
- How an SSL connection is established
An SSL connection between a client and server is set up by a handshake, the goals of which are: To s ...
- java链接Mysql出现警告: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
Java使用mysql-jdbc连接MySQL出现如下警告: Establishing SSL connection without server's identity verification is ...
- 解决Establishing SSL connection without server‘s identity verification is not recommended.
每次从数据库中进行查询或者其他操作控制台都会出现以下警告,虽说不是error,但是很显眼.. WARN: Establishing SSL connection without server's id ...
随机推荐
- Java基础笔试练习(十一)
1.下面的方法,当输入为2的时候返回值是多少? public static int getValue(int i) { int result = 0; switch (i) { case 1: res ...
- Prism
网址:https://prismjs.com 使用教程:https://www.cnblogs.com/zhibu/p/6272338.html 使用教程:https://www.zlinet.com ...
- Python3定时器任务代码
使用threading写的一个定时器任务demo: import time import sys import signal import datetime import threading #定时器 ...
- go 读取BMP文件头二进制读取
BMP文件头定义: WORD 两个字节 16bit DWORD 四个字节 32bit package main import ( "encoding/binary" "f ...
- go 缓冲IO
package main import ( "bufio" "fmt" "os" "strings" ) func ma ...
- RequestBody只能读取一次的问题
一.为什么只能读一次 原因很简单:因为是流.想想看,java中的流也是只能读一次,因为读完之后,position就到末尾了. 二.解决办法 思路:第一次读的时候,把流数据暂存起来.后面需要的时候,直接 ...
- .Net Core-类库中创建CodeFirst
本文仅用来学习记录. 搭建项目架构的时候,需要在类库中进行CodeFirst数据迁移 1.在项目的解决方案中,添加类库ERPFrame.Model 2.在类库项目中 添加实体模型和数据上下文 其中 ...
- Flutter Animation AnimatedBuilder
Flutter AnimatedBuilder 创建动画的widget Key key, @required Listenable animation, @required this.builder, ...
- vue实现滑块滑动校验
为了防止机器操作自动提交,我们需要添加滑动校验. 实现代码如下: 1.子组件slider.vue <template> <div class="drag" r ...
- UCOSII消息队列
主结构体 typedef struct os_q { /* QUEUE CONTROL BLOCK */ struct os_q *OSQPtr; /* Link to next queue cont ...