public class CertificateTrust
{
public static void SetCertificatePolicy()
{
//当在浏览器中可以正常访问,而code中出现错误时,可以用fiddle看下正常访问的SSl加密认证的版本号
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
ServicePointManager.ServerCertificateValidationCallback =
new System.Net.Security.RemoteCertificateValidationCallback(CheckValidationResult);
}
public static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{
return true;
}
} 连接client之前调用
CertificateTrust.SetCertificatePolicy();

webApi Authentication failed because the remote party has closed the transport stream\身份验证失败了,因为远程方关闭了传输流。的更多相关文章

  1. Mysql 连接提示 Client does not support authentication protocol requested by server 客户端不支持服务器请求的身份验证协议;考虑升级MySQL客户端

    由于查阅了很多百度文档发现很多方法比较复杂,所以写个备忘: 首先,进入MySQL 8.0Command Line Client -Unicode,输入密码,登录进去. 然后,在命令行输入:ALTER ...

  2. fatal: Authentication failed for “someurl”

    一.前言 我们在公司做项目,很多时候会遇到这个问题:Git failed with a fatal error. Authentication failed for ‘ http// xxx..... ...

  3. remote: Incorrect username or password ( access token ) fatal: Authentication failed for

    gitee推送到远程仓库时提示错误remote: Incorrect username or password ( access token )fatal: Authentication failed ...

  4. remote: http basic: access denied fatal: authentication failed for '‘解决办法

    问题描述 由于这个项目代码使用https 进行clone,为什么?因为代码库ssh有问题!fuck! 导致在push代码的时候出现了 remote: http basic: access denied ...

  5. Username for 'https://github.com': remote: Invalid username or password. fatal: Authentication failed for 'https://github.com/GLSmile/pythontest.git/' 问题

    使用$ git push -u origin master 进行同步时,提示输入用户名和密码,但是我输入正确的信息后,仍然 会报Username for 'https://github.com': r ...

  6. github提交失败并报错java.io.IOException: Authentication failed:

    一.概述 我最近在写一个android的项目. 软件:android studio.Android studio VCS integration(插件) Android studio VCS inte ...

  7. fatal: Authentication failed for又不弹出用户名和密码 解决办法

    各位,如果能弹出来,一定是你账号密码搞错了,就别继续看了.   image.png 切换命令行:   image.png 依然报错, 说到这个问题,又可以长篇大论了, 我使用的是tortoisegit ...

  8. Git在提交代码时出现的fatal: Authentication failed的问题

    git push origin master remote: Incorrect username or password ( access token ) fatal: Authentication ...

  9. windows 切换git远程仓库地址后 git push 提示Authentication failed

    git切换远程分支: 方法一: git remote set-url origin 你新的远程仓库地址 方法二: git remote rm origin git remote add origin ...

随机推荐

  1. 【Codeforces】879D. Teams Formation 思维+模拟

    题意 给定$n$个数,重复拼接$m$次,相邻$k$个重复的可消除,问最后序列中有多少个数 首先可以发现当$k>=n$时,如果要使$n$个数可以被消除,那么$n$个数必须一样,否则$n$个数不能被 ...

  2. poj-3666

    http://vjudge.net/problem/POJ-3666 题目是dp 题目;   简单dp 离散一下就好. 我们先来讲一讲不离散的,简单的懂了,其他的也很容易. dp[i] 代表这个数列以 ...

  3. 「BZOJ3083」遥远的国度(树剖换根

    3083: 遥远的国度 Time Limit: 10 Sec  Memory Limit: 512 MBSubmit: 4859  Solved: 1372[Submit][Status][Discu ...

  4. codevs 2102 石子归并2

    传送门 2102 石子归并 2  时间限制: 10 s  空间限制: 256000 KB  题目等级 : 黄金 Gold   题目描述 Description 在一个园形操场的四周摆放N堆石子,现要将 ...

  5. flask logger

    Flask uses standard Python logging. All Flask-related messages are logged under the 'flask' logger n ...

  6. 机器学习之SVM支持向量机

    前言            以下内容是个人学习之后的感悟,转载请注明出处~ 简介 支持向量机(support vector machine),简称SVM,通俗来讲,它是一种二类分类模型,其基本模型定义 ...

  7. Algorithm-4th part I 学习进度 (7/12)

    在cousera跟着书的原作者学习<算法>第四版.记录以下学习进度. 课后习题代码见我的GitHub 2018.09.22 : Priority Queues 使用完全二叉树实现优先队列 ...

  8. 2.7-2.8 导入、导出数据(进/出)hive表的方式

    一.导入数据进hive表 1.语法 LOAD DATA [LOCAL] INPATH 'filepath' [OVERWRITE] INTO TABLE tablename [PARTITION (p ...

  9. sql语句之约束条件

    not null约束,需设置默认值 sex enum('male','female') not null default 'male' unique 约束,值唯一 单列唯一: create table ...

  10. c语言编译器内置宏

    注:转自http://www.cnblogs.com/lixiaohui-ambition/archive/2012/08/21/2649052.html  感谢分享 前言: 我们在写程序的时候,总是 ...