Java 一些用户收到安全异常:尝试将沙盒 jar 作为可信库打开

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18142230/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 22:42:17  来源:igfitidea点击:

Some users gets Security Exception: Attempted to to open a sandboxed jar as a Trusted-Library

javasecurityexception

提问by KEBAN

We use applet on our application login page. Applet contains 2 classes. Jar is signed (ca certificate). Manifest file contains: "Trusted-Library: true.

我们在应用程序登录页面上使用小程序。Applet 包含 2 个类。Jar 已签名(ca 证书)。清单文件包含:“Trusted-Library:true。

It works for most of the users but some of them have problems with applet because JVM report Security Exception: Attempted to to open a sandboxed jar as a Trusted-Library.

它适用于大多数用户,但其中一些用户有小程序问题,因为 JVM 报告安全异常:尝试将沙盒 jar 作为受信任库打开。

Have you any idea why it wont work for them?

你知道为什么它对他们不起作用吗?

For exaple User1 has Java Plug-in 10.21.2.11 JRE version 1.7.0_21-b11 Java HotSpot(TM) Client VM. He try Firefox 21 and IE 8.0.6001.18702.

例如,用户 1 具有 Java 插件 10.21.2.11 JRE 版本 1.7.0_21-b11 Java HotSpot(TM) 客户端 VM。他尝试了 Firefox 21 和 IE 8.0.6001.18702。

JVM report General Exception:

JVM 报告一般异常:

basic: Plugin2ClassLoader.addURL parent called for 

https://www.sod.pfron.org.pl/_applet/Logowanie_8.32.2.48.jar
basic: Plugin2ClassLoader.addURL parent called for 

https://www.sod.pfron.org.pl/_applet/Logowanie_8.32.2.48.jar

security: Accessing keys and certificate in Mozilla user profile: null
security: JSS is not configured
security: Blacklist revocation check is enabled
security: blacklist: created: NEED_LOAD, lastModified: 1374827364000
security: blacklist: hasBeenModifiedSince 1374827396921 (we have 1374827364000)
security: Trusted libraries list check is enabled
security: blacklist: hasBeenModifiedSince 1374827583375 (we have 1374827364000)
network: Cache entry found [url: https://www.sod.pfron.org.pl/_applet/Logowanie_8.32.2.48.jar, version: null] prevalidated=false/0
cache: Adding MemoryCache entry: https://www.sod.pfron.org.pl/_applet/Logowanie_8.32.2.48.jar
cache: Resource https://www.sod.pfron.org.pl/_applet/Logowanie_8.32.2.48.jar has expired.
network: Connecting https://www.sod.pfron.org.pl/_applet/Logowanie_8.32.2.48.jar with proxy=DIRECT
security: blacklist: hasBeenModifiedSince 1374827435937 (we have 1374827364000)
security: blacklist: hasBeenModifiedSince 1374827390640 (we have 1374827364000)
security: blacklist: hasBeenModifiedSince 1374827583375 (we have 1374827364000)
network: CleanupThread used 268961 us
network: Connecting http://www.sod.pfron.org.pl:443/ with proxy=DIRECT
security: Loading Root CA certificates from C:\Program Files\Java\jre1.7.0_21\lib\security\cacerts
security: Loaded Root CA certificates from C:\Program Files\Java\jre1.7.0_21\lib\security\cacerts
security: Loading SSL Root CA certificates from C:\Program Files\Java\jre1.7.0_21\lib\security\cacerts
security: Loaded SSL Root CA certificates from C:\Program Files\Java\jre1.7.0_21\lib\security\cacerts
security: Loading Deployment SSL certificates from C:\Documents and Settings\Marek\Dane aplikacji\Sun\Java\Deployment\security\trusted.jssecerts
security: Loaded Deployment SSL certificates from C:\Documents and Settings\Marek\Dane aplikacji\Sun\Java\Deployment\security\trusted.jssecerts
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
security: Check if certificate can be verified using certificates in Root CA certificate store
security: Certificate to be verified:
[
<.....>
]
security: Certificate has been verified with Root CA certificates successfully
security: Invalid certificate from HTTPS server
basic: Dialog type is not candidate for embedding
security: Saving certificates in Deployment session certificate store
security: Saved certificates in Deployment session certificate store
network: ResponseCode for https://www.sod.pfron.org.pl/_applet/Logowanie_8.32.2.48.jar : 304
network: Encoding for https://www.sod.pfron.org.pl/_applet/Logowanie_8.32.2.48.jar : null
network: Disconnect connection to https://www.sod.pfron.org.pl/_applet/Logowanie_8.32.2.48.jar
cache: Reading Signers from 3935 https://www.sod.pfron.org.pl/_applet/Logowanie_8.32.2.48.jar | C:\Documents and Settings\Marek\Ustawienia lokalne\Dane aplikacji\Sun\Java\Deployment\cache.083407c-46587e7d.idx
cache: Done readSigners(https://www.sod.pfron.org.pl/_applet/Logowanie_8.32.2.48.jar)
cache:  Read manifest for https://www.sod.pfron.org.pl/_applet/Logowanie_8.32.2.48.jar: read=273 full=273
basic: Plugin2ClassLoader.isTrustedByPolicy called 
basic: Plugin2ClassLoader.isTrustedByPolicy returns false 
security: resource name "pl/computerland/sod/prezentacja/klient/cienki/applet/JavaVersion.class" in https://www.sod.pfron.org.pl/_applet/Logowanie_8.32.2.48.jar : java.lang.SecurityException: attempted to open sandboxed jar https://www.sod.pfron.org.pl/_applet/Logowanie_8.32.2.48.jar as a Trusted-Library
security: resource name "pl/computerland/sod/prezentacja/klient/cienki/applet/JavaVersion.class" in https://www.sod.pfron.org.pl/_applet/Logowanie_8.32.2.48.jar : java.lang.SecurityException: attempted to open sandboxed jar https://www.sod.pfron.org.pl/_applet/Logowanie_8.32.2.48.jar as a Trusted-Library
basic: exception: attempted to open sandboxed jar https://www.sod.pfron.org.pl/_applet/Logowanie_8.32.2.48.jar as a Trusted-Library.
java.lang.SecurityException: attempted to open sandboxed jar https://www.sod.pfron.org.pl/_applet/Logowanie_8.32.2.48.jar as a Trusted-Library
    at com.sun.deploy.security.CPCallbackHandler$ParentElement.checkResource(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.checkResource(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.getResource(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.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.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.SecurityException: attempted to open sandboxed jar https://www.sod.pfron.org.pl/_applet/Logowanie_8.32.2.48.jar as a Trusted-Library
basic: exception: attempted to open sandboxed jar https://www.sod.pfron.org.pl/_applet/Logowanie_8.32.2.48.jar as a Trusted-Library.
java.lang.SecurityException: attempted to open sandboxed jar https://www.sod.pfron.org.pl/_applet/Logowanie_8.32.2.48.jar as a Trusted-Library
    at com.sun.deploy.security.CPCallbackHandler$ParentElement.checkResource(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.checkResource(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.getResource(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.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.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.SecurityException: attempted to open sandboxed jar https://www.sod.pfron.org.pl/_applet/Logowanie_8.32.2.48.jar as a Trusted-Library
basic: Dialog type is not candidate for embedding
basic: Dialog type is not candidate for embedding
basic: Removed progress listener: sun.plugin.util.ProgressMonitorAdapter@5dcf43
security: Reset deny session certificate store
basic: Removed progress listener: sun.plugin.util.ProgressMonitorAdapter@1b93cf8
security: Reset deny session certificate store

回答by bdaniliuc

We have a similar problem. For us the issue was that the jre\lib\security\java.policy file on the client machine was modified with the addition of:

我们有类似的问题。对我们来说,问题是客户端机器上的 jre\lib\security\java.policy 文件被修改为添加了:

grant {
    permission java.security.AllPermission;
};

If this was removed the error disappeared. Also in our test the error disappeared if we removed Trusted-Library: true, but that is not really an option considering the new Java applet rules.

如果将其删除,则错误消失。同样在我们的测试中,如果我们删除 Trusted-Library: true,错误就会消失,但考虑到新的 Java 小程序规则,这不是一个真正的选择。

We've also posted the information here https://forums.oracle.com/message/11238296#11238296but with no reply for now.

我们也在此处发布了信息https://forums.oracle.com/message/11238296#11238296但目前没有回复。