用HttpClient发送HTTPS请求报SSLException: Certificate for <域名> doesn’t match any of the subject alternativ
用exchage获取Outlook数据服务是因为证书问题导致,现在需要去除证书验证就可以访问了。
ExchangeService service = new ExchangeServiceWithHostVerify(ExchangeVersion.Exchange2010_SP2);
/*** 重写ExchangeService类,不对任何域名做验证*/ private static class ExchangeServiceWithHostVerify extends ExchangeService {// 不对任何域名做验证private final static HostnameVerifier hostnameVerifierWithOutVerfy = new HostnameVerifier() {@Overridepublic boolean verify(String s, SSLSession sslSession) {return true;}};public ExchangeServiceWithHostVerify(ExchangeVersion requestedServerVersion) {super(requestedServerVersion);}@Overrideprotected Registry<ConnectionSocketFactory> createConnectionSocketFactoryRegistry() {try {return RegistryBuilder.<ConnectionSocketFactory>create().register(EWSConstants.HTTP_SCHEME, new PlainConnectionSocketFactory()).register(EWSConstants.HTTPS_SCHEME, EwsSSLProtocolSocketFactory.build(null, hostnameVerifierWithOutVerfy)).build();} catch (GeneralSecurityException e) {throw new RuntimeException("Could not initialize ConnectionSocketFactory instances for HttpClientConnectionManager", e);}}
用HttpClient发送HTTPS请求报SSLException: Certificate for <域名> doesn’t match any of the subject alternativ相关推荐
- 用HttpClient发送HTTPS请求报SSLException: Certificate for <域名> doesn‘t match any of the subject alternative
目录 1:HttpClient 的https证书验证请求问题 2: post请求示例 3: get请求示例 1:HttpClient 的https证书验证请求问题 最近用http 推送,用apache ...
- HttpClient发送Https请求报 : unable to find valid certification path to requested target
一.场景 近期在对接第三方接口时,通过HttpClient发送Https请求报 : unable to find valid certification path to requested tar ...
- Java使用HttpClient发送Https请求证书失效:PKIX path building failed:
最近使用HttpClient对接第三方短信接口,在进行本地测试时报了一个证书失效的错误. 1. 封装的HttpClient的Post请求 public static Map<String, Ob ...
- 如何解决httpclient调用https请求报错
public static CloseableHttpClient getClient() {SSLContext sslContext = null;try {sslContext = new SS ...
- python https请求报错:SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] 解决方法
python爬虫,使用requests库发送https请求报错:SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] 解决方法: imp ...
- springboot 使用restTemplate 发送https请求 忽略ssl证书
最近在写接口的时候给对方回推数据,发送https请求的时候遇到这么个报错:javax.net.ssl.SSLHandshakeException: sun.security.validator.Val ...
- Ionic+Angular+Express实现前后端交互使用HttpClient发送get请求数据并加载显示(附代码下载)
场景 Ionic介绍以及搭建环境.新建和运行项目: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/106308166 在上面搭建起 ...
- RestTemplate 发送 Https 请求调用
RestTemplate 发送 Https 请求调用 个人博客:https://jacob.org.cn import org.apache.http.conn.ssl.NoopHostnameVer ...
- Httpclient发送json请求
一.Httpclient发送json请求 public String RequestJsonPost(String url){ String strresponse = null; t ...
最新文章
- Win7封装无损廋身清单
- 【个人随笔】准备整理整理以往的资料
- 2017-2018-2 20179204《网络攻防实践》第八周学习总结
- 1018 Public Bike Management (30 分) 【难度: 难 / 知识点: 图论 最短路 图的遍历】
- Spring 事务基于注解和xml方式
- 三种Target Encoding方式总结
- close关闭指定窗口 matlab_Δ-Σ ADC设计笔记一:MATLAB环境设置
- mysql php 流式读取_PHP MySQL 读取数据
- numpy-array
- java 读取Zip文件进行写入
- SharePoint 2010 获取列表全部定义方法
- Python+Appium+夜神模拟器安装与简单运行(2/2)
- 2)Thymeleaf 标准表达式语法详解
- 如何查看mysql 的端口号?
- 【转】斐波那契数列算法分析
- 【eoeAndroid特刊】第一期到第十八期
- 银行数据仓库体系实践(15)--数据应用之巴塞尔新资本协议
- markdown 删除线
- linux系统发送短信,Linux系统的短信收发怎么实现?
- C#WinForm判断界面上多个TextBox控件的值是否为空
热门文章
- Fiddler对数据包的拦截(打断点、设置断点)、改包、伪造(构造)、自动响应
- 「01」机器学习,到底在学些什么?
- INI文件编程,WINAPI函数WritePrivateProfileString,GetPrivateProfileString
- 上市公司女性高管指标 1999-2020年(内附详细指标说明及代码)
- 无主之地2服务器信号差,更新无主之地2时无法连接到更新服务器 | 手游网游页游攻略大全...
- icalendar_家庭日历管理-在Outlook和Web日历之间共享生活以及iCalendar的魔力
- eslint 换行_eslint 常用配置
- 高超声速飞行器鲁棒控制系统的设计
- 【圣斗士星矢的状态模式和观察者模式】
- OpenGL蓝宝书第五版案例资源