使用HTTPS在Firefox中加载Java Applet

时间:2014-02-09 19:34:07

标签: django internet-explorer firefox https applet

我们开发了一个分析应用程序,它使用特殊的Java小程序(由IBM开发)来查看某些数据。这是一个在Apache上运行的Django应用程序。一切正常,直到我们转向SSL。这种行为非常奇怪,我们感到困惑,有点担心如何让applet在HTTPS上工作。 好的,我已经阅读了许多关于JRE 7u51(Java JRE插件)中引入的安全更新的主题,但我认为这不是我们出现问题的原因。

我目前的环境是:

  • Firefox:版本27.0
  • IE Explorer:版本10.0.12
  • Apache:2.2版
  • 在Apache中定义的SSL证书:使用openssl生成的自签名证书

在HTTP上运行 Java applet在两个浏览器(Firefox,IE)上运行,数据显示正确。

在HTTPS上运行:

A)IE浏览器:Java applet运行时没有错误,数据显示正确。

B)Firefox:抛出ClassNotFoundException。详细说明:

    cache: Initialize resource manager: com.sun.deploy.cache.ResourceProviderImpl@499f7d
basic: Added progress listener: sun.plugin.util.ProgressMonitorAdapter@1e95d95
basic: Plugin2ClassLoader.addURL parent called for https://demoapp.domain.com/s/ixv/i2Viewer.jar
security: Accessing keys and certificate in Mozilla user profile: null
security: JSS is not configured
basic: Loading Java Applet ...
network: Cache entry not found [url: https://demoapp.domain.com/s/ixv/i2Viewer.jar, version: null]
network: Connecting https://demoapp.domain.com/s/ixv/i2Viewer.jar with proxy=DIRECT
network: Connecting http://demoapp.domain.com:443/ with proxy=DIRECT
security: Loading certificates from Deployment session certificate store
security: Loaded certificates from Deployment session certificate store
security: Checking if SSL certificate is in Deployment permanent certificate store
java.net.SocketException: Software caused connection abort: recv failed
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(Unknown Source)
    at java.net.SocketInputStream.read(Unknown Source)
    at sun.security.ssl.InputRecord.readFully(Unknown Source)
    at sun.security.ssl.InputRecord.read(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.waitForClose(Unknown Source)
    at sun.security.ssl.HandshakeOutStream.flush(Unknown Source)
    at sun.security.ssl.Handshaker.sendChangeCipherSpec(Unknown Source)
    at sun.security.ssl.ClientHandshaker.sendChangeCipherAndFinish(Unknown Source)
    at sun.security.ssl.ClientHandshaker.serverHelloDone(Unknown Source)
    at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
    at sun.security.ssl.Handshaker.processLoop(Unknown Source)
    at sun.security.ssl.Handshaker.process_record(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
    at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source)
    at sun.plugin.PluginURLJarFileCallBack.connect(Unknown Source)
    at sun.plugin.PluginURLJarFileCallBack.retrieve(Unknown Source)
    at sun.net.www.protocol.jar.URLJarFile.retrieve(Unknown Source)
    at sun.net.www.protocol.jar.URLJarFile.getJarFile(Unknown Source)
    at sun.net.www.protocol.jar.JarFileFactory.get(Unknown Source)
    at sun.net.www.protocol.jar.JarURLConnection.connect(Unknown Source)
    at sun.plugin.net.protocol.jar.CachedJarURLConnection.connect(Unknown Source)
    at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFileInternal(Unknown Source)
    at sun.plugin.net.protocol.jar.CachedJarURLConnection.getJarFile(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$1000(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager.initAppletAdapter(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
network: Cache entry not found [url: https://demoapp.domain.com/investigation/com/VDK/viewer/Chart.class, version: null]
network: Connecting https://demoapp.domain.com/investigation/com/VDK/viewer/Chart.class with proxy=DIRECT
network: Connecting http://demoapp.domain.com:443/ with proxy=DIRECT
security: Loading certificates from Deployment session certificate store
security: Loaded certificates from Deployment session certificate store
security: Checking if SSL certificate is in Deployment permanent certificate store
network: Cache entry not found [url: https://demoapp.domain.com/investigation/com/VDK/viewer/Chart/class.class, version: null]
network: Connecting https://demoapp.domain.com/investigation/com/VDK/viewer/Chart/class.class with proxy=DIRECT
network: Connecting http://demoapp.domain.com:443/ with proxy=DIRECT
security: Loading certificates from Deployment session certificate store
security: Loaded certificates from Deployment session certificate store
security: Checking if SSL certificate is in Deployment permanent certificate store
java.lang.ClassNotFoundException: com.VDK.viewer.Chart.class
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager.initAppletAdapter(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
basic: load: class com.VDK.viewer.Chart.class not found.
java.lang.ClassNotFoundException: com.VDK.viewer.Chart.class
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager.initAppletAdapter(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Ignored exception: java.lang.ClassNotFoundException: com.VDK.viewer.Chart.class
basic: Dialog type is not candidate for embedding
basic: Removed progress listener: sun.plugin.util.ProgressMonitorAdapter@1e95d95
security: Reset deny session certificate store

最后,我想补充说,在使用JRE 6运行applet时,我们遇到了同样的问题,并且在META-INF中没有适用于JRE 7u51的参数。所以我认为Java JRE(插件版本)的版本不是我们问题的原因。更重要的是,applet在IE Explorer(HTTP和HTTPS)上运行良好。

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

我认为错误信息已经给出了答案:

  

检查SSL证书是否在部署永久证书中   存储

你说你使用自签名证书? 原因可能是java(正确)拒绝自签名证书。您是否确保此证书位于Java信任库中? Java使用与证书不同的商店作为Web浏览器。您可以在系统属性\ Java \安全\管理证书下找到它,并且您可以在那里导入证书......

背景资料:

该地区目前有三个信托商店:

  • Windows系统证书存储(IE和Chrome也使用)
  • Firefox证书商店(我在某处读过他们将来会转到Windows证书商店,但不确定)
  • Java证书商店