JavaFX WebView无法加载HTTPS页面 [英] JavaFX WebView Not Loading HTTPS Page

查看:138
本文介绍了JavaFX WebView无法加载HTTPS页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用JavaFX WebView控件编写了一个浏览器.一切正常,直到我尝试加载加密的页面为止.我尝试 https://www.gmail.com ,并且在负载工人.仅当我将应用程序打包为独立程序时才会发生这种情况.当我在NetBeans中运行项目时,一切都很好.我猜想它与SSL证书有关,但是我尝试了几乎所有我能想到的事情,包括使用"keytool"将每个证书导入到信任存储中,但是没有任何效果.

I have written a browser using the JavaFX WebView control. Everything is fine until I try to load an encrypted page. I try https://www.gmail.com and I get an "Unknown Error" in the exception property of the load worker. This only happens when I package the application as a stand-alone; when I run the project in NetBeans everything is fine. I am guessing it has to do with SSL certificates, but I tried pretty much everything I could think of, including importing each certificate in the trust store with "keytool," but nothing works.

有什么想法吗?非常感激.谢谢.

Any ideas? Much appreciated. Thanks.

推荐答案

从IDE(Eclipse,Netbean)启动时,浏览器是否可以使用https站点? 如果是这样,差异可能就是JRE. 您可能需要将文件sunjce_provider.jar复制到捆绑的JRE. 我使用Mac,位于/Library/Java/JavaVirtualMachines/jdk1.7.0_06.jdk/Contents/Home/jre/lib/ext.中的sunjce_provider.jar.

Does your browser work with https sites when launching from an IDE (Eclipse, Netbean)? If so, the difference might be the JRE. You might need to copy the file sunjce_provider.jar to the bundled JRE. I use a Mac and sunjce_provider.jar is located in /Library/Java/JavaVirtualMachines/jdk1.7.0_06.jdk/Contents/Home/jre/lib/ext.

这篇关于JavaFX WebView无法加载HTTPS页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆