旭日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解决方法的更多相关文章

  1. win7 X64 使用VS2008 ->编译报错LINK : fatal error LNK1000: Internal error during Incr的解决

    编译报错LINK : fatal error LNK1000: Internal error during Incr的解决 Win7 旗舰版 Microsoft Visual Studio 2008 ...

  2. 输入指令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 ...

  3. 运行python脚本时,报错InsecurePlatformWarning: A true SSLContext object is not available,解决方法

    今天,要在新环境里运行一个python脚本,遇到下面的报错: /usr/lib/python2.7/site-packages/urllib3/util/ssl_.py:160: InsecurePl ...

  4. centos在yum install报错:Another app is currently holding the yum lock解决方法

    centos在yum install报错:Another app is currently holding the yum lock,这个问题可能是很多的新手经常遇到问题,之前也有人问我,包括本人在刚 ...

  5. Oracle 安装报错 [INS-06101] IP address of localhost could not be determined 解决方法[转]

    --安装Oracle 11gR2,报错:[INS-06101] IP address of localhost could not be determined--------------------- ...

  6. 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 ...

  7. 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 ...

  8. 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 ...

  9. 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 ...

随机推荐

  1. 从Java到JVM到OS线程睡眠

    Java 中有时需要将线程进入睡眠状态,这时一般我们就会通过 Thread.sleep 使线程进入睡眠状态,接下去就看看执行该语句在 JVM 中做了什么. 简单例子 以下是一个简单的例子,使主线程睡眠 ...

  2. Not posting notification with icon==0问题解决

    问题:E/NotificationService: Not posting notification with icon==0: Notification(pri=0 contentView=null ...

  3. 第五节:详细讲解Java中的接口与继承

    前言 大家好,给大家带来详细讲解Java中的接口与继承的概述,希望你们喜欢 什么是接口(interface) 接口中的方法都是抽象方法,public权限,全是抽象函数,不能生成对象 interface ...

  4. mysql怎么限制ip访问

    grant all privileges on *.* to 'root'@'ip'identified by '密码'; #授权某个ip的用户可以通过密码访问数据库

  5. 卷积神经网络CNN的原理(二)---公式推导

    卷积神经网络与普通神经网络的区别在于,卷积神经网络包含多个由卷积层和池化层构成的特征抽取器.在卷积神经网络的卷积层中,一个神经元只与部分邻层神经元连接.在CNN的一个卷积层中,通常包含若干个特征平面( ...

  6. Ubuntu 18.04安装配置pure-ftpd解决中文乱码问题

    之前用的是vsftpd配置ftp服务器,前面用的挺好,没什么问题,但是后面接收设备上传的文件夹时发现了一个大坑,当设备上传的文件夹名字中包含中文时,在Linux上显示的是乱码...各种转码都不行,折腾 ...

  7. vue 自学笔记记录

    vue 自学笔记(一): 知识内容:  安装vue ,创建vue实例,安装第一个组件,单项数据流 https://www.cnblogs.com/baili-luoyun/p/10763163.htm ...

  8. PHP的会话控制

    页面数据的作用域: 当前页共享数据:变量.常量 两个页面间传递数据:get,post 跟踪用户的多页面数据共享(会话):session.cookie 全局数据共享:文件.数据库.memcached C ...

  9. 使用SAX解析xml文档

    1.首先,在main方法中解析xml文档,具体代码如下: import org.w3c.dom.*; import javax.xml.parsers.DocumentBuilder; import ...

  10. supervisor 启动dotnet.core 报“ too many start retries too quickly”

    环境: 操作系统:Centos 7 dotnet core:2.0.0    2.1.3 问题: 在使用supervisor 配置守护进程时,启动dotnet.core程序失败,查看/tmp下supe ...