Java 您的安全设置阻止了使用过期或尚未生效的证书签名的应用程序运行

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26991864/
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 03:37:12  来源:igfitidea点击:

Your security settings have blocked an application signed with an expired or not-yet-valid certificate from running

javasecurityapplet

提问by Vicky Thakor

Application blocked by security settings error on client' Windows8 OS

客户端 Windows8 操作系统上的安全设置错误阻止了应用程序

I checked above question but it didn't help me so looking for other solution.

我检查了上面的问题,但它没有帮助我所以寻找其他解决方案。

Few days back our code signing certificate for applet is expired. We renewed it and I created new jar again and signed this applet with renewed certificate and now I'm getting an exception.

几天前,我们的小程序代码签名证书已过期。我们更新了它,我再次创建了新的 jar 并使用更新的证书签署了这个小程序,现在我得到了一个例外。

com.sun.deploy.security.BlockedException: Your security settings have blocked an application signed with an expired or not-yet-valid certificate from running
    at com.sun.deploy.security.SandboxSecurity.showBlockedDialog(Unknown Source)
    at com.sun.deploy.security.TrustDecider.askUser(Unknown Source)
    at com.sun.deploy.security.TrustDecider.validateChain(Unknown Source)
    at com.sun.deploy.security.TrustDecider.isAllPermissionGranted(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.isTrustedByTrustDecider(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.getTrustedCodeSources(Unknown Source)
    at com.sun.deploy.security.CPCallbackHandler$ParentCallback.strategy(Unknown Source)
    at com.sun.deploy.security.CPCallbackHandler$ParentCallback.openClassPathElement(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.access00(Unknown Source)
    at com.sun.deploy.security.DeployURLClassPath$JarLoader.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.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.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)

I removed all existing certificate from Java Control Panel and I open our website where I'm getting new certificate details in applet. Latest expiry date but when I click on Runits throwing an exception.

我从 Java 控制面板中删除了所有现有证书,并打开了我们的网站,我在小程序中获得了新的证书详细信息。最新的到期日期但是当我点击Run它时抛出异常。

enter image description here

在此处输入图片说明

I checked Java Control Panel again then its showing old certificate why new certificate is not used by Java?

我再次检查了 Java 控制面板,然后它显示了旧证书,为什么 Java 不使用新证书?

enter image description here

在此处输入图片说明

回答by vmishra

Essentially you'll have to re-sign your JARs within your deployed ear/war with a new trusted certificate. Until then there are workarounds, There are two things you can do here:

本质上,您必须使用新的受信任证书在部署的耳朵/战争中重新签署 JAR。在此之前,有一些解决方法,您可以在这里做两件事:

  1. Goto Control Panel -> Java -> Security -> Edit Site List
  1. 转到控制面板 -> Java -> 安全 -> 编辑站点列表

Add you application url, wildcards are accepted. Kindly note that you might have to close the browser and start again, to be able to read the new configuration.

添加您的应用程序 url,接受通配符。请注意,您可能需要关闭浏览器并重新启动,才能读取新配置。

  1. In the java control panel security tab, reduce the security level to medium, apply, ok and restart your browser. It should work.
  1. 在java控制面板安全选项卡中,将安全级别降低到中等,应用,确定并重新启动浏览器。它应该工作。

enter image description here

在此处输入图片说明

回答by John.J

Create file in the user's home directory:

在用户的主目录中创建文件:

/usr/home/username/.java/deployment/security/security/exception.sites

Add the sites that should be given exception.

添加应给予例外的站点。

https://192.168.70.10

But if you prefer a GUI application, run JControland create exception site list.

但是,如果您更喜欢 GUI 应用程序,请运行JControl并创建例外站点列表。