最近在做Webservice的接口调用,header的用户名和密码都是正确的,地址也是对的,但一直提示:基础连接已关闭,未能与SSL/TLS安全通道建立信任关系。

解决方案:

请求之前加上下面得代码即可,简洁实用

1.

ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) => true;

2.

ServicePointManager.ServerCertificateValidationCallback = new
RemoteCertificateValidationCallback
(
delegate { return true; }
);

这样做会潜在一定风险

所有验证都会通过,不论是否证书是无效得。whatever ,还有其他方案? 或者针对特定链接这样做就好了

1.This will accept all certificates, regardless of why they are invalid, which resolved the customer’s issue.

By validating the X509 certificate provided by the computer running Microsoft Exchange Server 2007 for SSL over HTTP, you help to provide a layer of security for the client application. You must validate certificates before you can start programming with Exchange Web Services proxy classes. If the callback is not set up, the first call will fail with a certificate error.

2.This solution could be potential security threat as you are turning off the SSL certificate validation. If this is production code, understand the risk of the server you are connecting to.

原文地址:https://www.cnblogs.com/miralce/p/4773037.html

调用含有header的WebService时,跳过证书验证的更多相关文章

  1. Ajax在调用含有SoapHeader的webservice方法

    ·         [WebService(Namespace = "http://tempuri.org/")] ·             [WebServiceBinding ...

  2. Xcode中使用svn时,报证书验证错误Error validating server certificate for

    转:http://blog.csdn.net/yhawaii/article/details/7511141 今天使用Xcode自带的svn客户端时,总是连接不上服务器,报如下错误: Error va ...

  3. java httpclient 跳过证书验证

    import java.io.IOException;import java.net.InetAddress;import java.net.Socket;import java.net.Unknow ...

  4. Https Webservice接口的免证书调用

    目录 前言 思路 方案 Axis调用 HttpClient调用 参考链接 前言 在调用https协议的Webservice接口时,如果没有做证书验证,一般会报javax.net.ssl.SSLHand ...

  5. 用C#.NET调用Java开发的WebService传递int,double问题

    用C#.NET调用Java开发的WebService时,先在客户端封装的带有int属性的对象,当将该对象传到服务器端时,服务器端可以得到string类型的属性值,却不能得到int类型.double和D ...

  6. 用C#.NET调用Java开发的WebService传递int,double问题,出现java无法获得值!

    https://www.cnblogs.com/zhbsh/archive/2013/04/22/3035477.html 用C#.NET调用Java开发的WebService时,先在客户端封装的带有 ...

  7. .net core中引用webservice,并忽略https证书验证

    1.打开vs, 工具-->扩展和更新 下载这个 2. 在admin下右键,添加-->connected service 选择wsdl文件路径,或者服务的url,比如https://**** ...

  8. 动态调用webservice时 ServiceDescriptionImporter类在vs2010无法引用的解决方法

    [导读]ServiceDescriptionImporter是创建Web Service 时使用的类,它是引用继承System.Web.Services 当我将VS2005里写的一段代码放在VS201 ...

  9. delphi7调用java写的webservice,在调用的时候弹出“wssecurityhandler:request does not contain required security header”

    delphi7调用java编写的webservice问题我用delphi7调用java写的webservice,在调用的时候弹出“wssecurityhandler:request does not ...

  10. C#调用WebService时插入cookie

    SOAPUI插入Cookie的方法 SOAP插入cookie的方法如下,点击Head,点击加号,然后直接设置就可以了. C#中调用webService时插入Cookie 由于调用的时候必须要带上coo ...

随机推荐

  1. linux常用命令(七)

    用于系统内信息交流的相关命令 echo mesg wall write echo:在显示器上显示文字 命令语法:echo[选项] [字符串] 选项 选项含义 -n 表示输出文字后不换行 例子:将文本& ...

  2. Android利用广播监听按下HOME和电源键

    package cc.testhome; import cc.testhome.HomeKeyObserver.OnHomeKeyListener; import cc.testhome.PowerK ...

  3. log4j2同步日志引发的性能问题

    1 问题回顾 1.1 问题描述 在项目的性能测试中,相关的接口的随着并发数增加,接口的响应时间变长,接口吞吐不再增长,应用的CPU使用率较高. 1.2 分析思路 谁导致的CPU较高,阻塞接口TPS的增 ...

  4. Util应用框架 UI 开发快速入门

    本文是Util应用框架 Angular UI 开发快速入门教程. Util前端技术概述 Util 应用框架目前仅支持用于开发管理后台的 UI. 本文介绍了 Util UI 的技术特点和功能支持. UI ...

  5. Neural Networks投稿要求总结

    自用,NN投稿要求,相关的部分的中文版翻译,原文链接:https://www.sciencedirect.com/journal/neural-networks/publish/guide-for-a ...

  6. 按键1按下数码管显示1,按键2按下数码管显示2,按键3按下8个LED灯实现流水灯效果;

    #include "reg52.h" //此文件中定义了单片机的一些特殊功能寄存器 #include<intrins.h> //因为要用到左右移函数,所以加入这个头文件 ...

  7. 【VMware vCenter】使用cmsso-util命令进行链接、删除、修改多个vCenter Server(VCSA)的SSO域。

    VMware vCenter Server 支持新安装的时候选择将vCenter SSO域加入到另外一个现有的SSO域中,同时也支持使用cmsso-util命令将现有的两个或多个vCenter SSO ...

  8. java读取照片Exif信息到实体类

    前言 1.总共读出来了228个参数信息,但是我挑选了36个我认为比较有价值的参数,弄成了实体类 (其实是因为很多参数我看不明白是啥意思) 2.为了方便,所以实体类里我直接用中文字段了 效果图 导入依赖 ...

  9. 小满OKKICRM与金蝶云星空对接集成客户资料

    小满OKKICRM与金蝶云星空对接集成客户列表查询(更新列表)&客户新增(小满客户对接金蝶客户-P) 数据源平台:小满OKKICRM 小满科技成立于2013年,是阿里巴巴集团战略投资的高新技术 ...

  10. 环形缓冲区 Ring Buffer 的实现

    环形缓冲区(Circular Buffer 或 Ring Buffer)是一种数据结构,它在逻辑上形成一个闭环.这种结构非常适用于需要固定大小的缓冲区的情况,如音频处理.网络通信.实时数据传输等.环形 ...