Https协议报错:com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl解决方法
旭日Follow_24 的CSDN 博客 ,全文地址请点击:
https://blog.csdn.net/xuri24/article/details/82220333
所用应用服务器:JBoss服务器
jdk环境:jdk1.6
通信协议:http/https
场景:本地项目对接外部项目(接口编程),尤其银行对接等;
使用外部系统提供的sdk,sdk中封装好了http通信协议等。使用sdk进行调用正常,当导入本地项目对接时,调用请求出现报错:
sun.net.www.protocol.http.HttpURLConnection cannot be cast to javax.net.ssl.HttpsURLConnection
意思大概是的HttpURLConnection http协议无法转换成https协议。
解决方法:
找到项目对应的请求处理类,对应方法。通常是:HTTP Request的封装请求方法那个地方。
将 URL url= new URL(url); 改为 URL url= new URL(null, url, new sun.net.www.protocol.https.Handler());
即可解决问题。
Https协议报错:com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl解决方法的更多相关文章
- win7 X64 使用VS2008 ->编译报错LINK : fatal error LNK1000: Internal error during Incr的解决
编译报错LINK : fatal error LNK1000: Internal error during Incr的解决 Win7 旗舰版 Microsoft Visual Studio 2008 ...
- 输入指令npx webpack-dev-server报错:Error: Cannot find module ‘webpack-cli/bin/config-yargs‘的解决方法
输入指令npx webpack-dev-server报错:Error: Cannot find module 'webpack-cli/bin/config-yargs'的解决方法 输入指令:npx ...
- 运行python脚本时,报错InsecurePlatformWarning: A true SSLContext object is not available,解决方法
今天,要在新环境里运行一个python脚本,遇到下面的报错: /usr/lib/python2.7/site-packages/urllib3/util/ssl_.py:160: InsecurePl ...
- centos在yum install报错:Another app is currently holding the yum lock解决方法
centos在yum install报错:Another app is currently holding the yum lock,这个问题可能是很多的新手经常遇到问题,之前也有人问我,包括本人在刚 ...
- Oracle 安装报错 [INS-06101] IP address of localhost could not be determined 解决方法[转]
--安装Oracle 11gR2,报错:[INS-06101] IP address of localhost could not be determined--------------------- ...
- JMeter3.0启动日志报错WARN - org.jmeterplugins.repository.Plugin: Unable to load class解决方法
解决方法: 通过sh find-in-jars 'HlsSampler' -d /data/apache-jmeter-3.0/lib/ext/确定这个class文件在哪个jar包 由于find-in ...
- Oracle 安装报错 [INS-06101] IP address of localhost could not be determined 解决方法
安装Oracle 11gR2,报错:[INS-06101] IP address of localhost could not be determined 出现这种错误是因为主机名和/etc/host ...
- phpmyadmin登录报错crypt_random_string requires at least one symmetric cipher be loaded 解决方法
通过phpmyadmin登陆时提示以下错误: phpmyadmin crypt_random_string requires at least one symmetric cipher be load ...
- Oracle 安装报错 [INS-06101] IP address of localhost could not be determined 解决方法输入日志标题
安装Oracle 11gR2,报错:[INS-06101] IP address of localhost could not be determined 出现这种错误是因为主机名和/etc/host ...
随机推荐
- Openvswitch手册(9): Flow
这一节我们将flow table flow table主要由ovs-ofctl命令操作 ovs-ofctl可以走和openflow controller一样的协议: ssl:ip[:port]: Th ...
- Monad Explained in One Picture
The point of Monad is composability. In the green category, T -> Monad<U> and U -> Monad ...
- Hadoop 电话通信清单
一.实例要求 现有一批电话通信清单,记录了用户A拨打某些特殊号码(如120,10086,13800138000等)的记录.需要做一个统计结果,记录拨打给用户B的所有用户A. 二.测试样例 样例输入: ...
- 还在使用SimpleDateFormat?
阅读本文大概需要 3.2 分钟. 前言 日常开发中,我们经常需要使用时间相关类,想必大家对SimpleDateFormat并不陌生.主要是用它进行时间的格式化输出和解析,挺方便快捷的,但是Simple ...
- SpringBoot+Mybatis集成搭建
本博客介绍一下SpringBoot集成Mybatis,数据库连接池使用alibaba的druid,使用SpringBoot微框架虽然集成Mybatis之后可以不使用xml的方式来写sql,但是用惯了x ...
- editormd实现文章详情页面预览
继之前博客写了editmd.js(国内开源的一款前端Markdown框架)实现的写文章功能之后,本博客介绍使用editormd实现文章预览功能,之前博客链接:https://blog.csdn.net ...
- java 实现一个beautiful的弹层和具体功能
先看一下弹层的效果: 点击确定跳转百度页面,点击取消弹层消失. 我这个弹层是在layui找的, 1. 需要layui.css文件和layui.js文件 (想我这样笨的人,没有同学的告知,我都不知道去哪 ...
- java并发编程知识点备忘
最近有在回顾这方面的知识,稍微进行一些整理和归纳防止看了就忘记. 会随着进度不断更新内容,比较零散但尽量做的覆盖广一点. 如有错误烦请指正~ java线程状态图 线程活跃性问题 死锁 饥饿 活锁 饥饿 ...
- java.util.regex包下的Pattern类和Matcher类的使用总结
一.介绍 Java正则表达式通过java.util.regex包下的Pattern类与Matcher类实现1.Pattern类用于创建一个正则表达式,也可以说创建一个匹配模式,它的构造方法是私有的,不 ...
- wamp解决ajax跨域问题
若使用ajax测试本地数据时,遇到的跨域问题,如 因为ajax只能用于请求服务器的数据,而在本地测试,打开的文件是以 file:// 的形式, 所以报错 可以通过 nginx 建立反向代理,处理静态文 ...