码上敲享录 > java常见报错解答 > 解决sun.net.www.protocol.http.HttpURLConnection cannot be cast to javax.net.ssl.HttpsURLConnection

解决sun.net.www.protocol.http.HttpURLConnection cannot be cast to javax.net.ssl.HttpsURLConnection

上一章章节目录下一章 2018-11-01已有13017人阅读 评论(0)

sun.net.www.protocol.http.HttpURLConnection cannot be cast to javax.net.ssl.HttpsURLConnection


解决方法:

报错的写法:URL realUrl = new URL(url);

不报错写法:URL realUrl= new URL(null, url, new sun.net.www.protocol.https.Handler());

HttpsURLConnection conn = (HttpsURLConnection) realUrl.openConnection();


本文链接:http://www.yayihouse.com/yayishuwu/chapter/1662

1

有建议,请留言!

  • *您的姓名:

  • *所在城市:

  • *您的联系电话:

    *您的QQ:

  • 咨询问题:

  • 提 交