如何在没有安全警告的情况下发布 Java Web Start jnlp 应用程序? [英] How to publish a Java Web Start jnlp application without security warnings?

查看:34
本文介绍了如何在没有安全警告的情况下发布 Java Web Start jnlp 应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个从网站上的 jnlp 文件启动的 Java 应用程序.我正在尝试让它运行,而不会在运行前闪现一堆安全警告.

该程序被分解为大约 10 个不同的 jar 文件、30 个左右的 jar 库,以及一些也包含在 jar 文件中的本地库.

我已经使用官方代码签名证书(来自 Verisign)对所有 jar 文件进行了签名,将 jnlp 文件包含在包含主类的 jar 文件中,并为主要的 10 个 jar 添加了权限和代码库属性我正在编译.

当我启动程序时,我收到一条消息:

<块引用>

此应用程序将在未来的 Java 安全更新中被阻止因为 JAR 文件清单不包含权限属性.请联系出版商了解更多信息.

我可以点击运行"来跳过这条消息,但是我得到:

<块引用>

阻止运行可能不安全的组件?应用程序包含有符号和无符号代码.

我已经为我正在编译的所有 jar 文件添加了权限属性.我是否也必须更新我正在使用的第三方库的 jar 清单?如果是这样,是否有一种简单的方法可以做到这一点?我正在使用 Apache Ant 构建应用程序.

解决方案

是的,你必须更新所有的 jars
您可以将这些属性直接添加到文件中的 jar 文件(所有 jar )的清单中 -

在你的插件目录中:

jar ufm 附加属性.txt

这个 additionalAttribute.txt 将包含您的附加清单属性,如 -

<块引用>

权限:所有权限代码库:*应用程序名称:我的应用程序调用者允许的代码库:*可信库:true应用程序库允许代码库:*

I have a Java application that is launched from a jnlp file off of a website. I'm trying to get it to run without flashing up a bunch of security warnings before it runs.

The program is broken up into about 10 different jar files, 30 or so jar libraries, and a couple native libraries also contained in jar files.

I've signed all of the jar files with an official code signing cert (from Verisign), included the jnlp file inside of the jar file that holds the main class, and added permissions and codebase attributes to the main 10 jars that I'm compiling.

When I launch the program I get the message stating:

This application will be blocked in a future Java security update because the JAR file manifest does not contain the Permissions attribute. Please contact the Publisher for more information.

I can click "Run" to get past this message, but then I get:

Block potentially unsafe components from being run? The application contains both signed and unsigned code.

I've added the permissions attribute to all of the jar files that I'm compiling. Do I have to update the jar manifest for the third-party libraries that I'm using as well? If so, is there an easy way to do this? I'm using Apache Ant to build the application.

解决方案

Yes , you have to update all jars
You can add these properties directly into manifest of the jar files (all jars) from a file -

In your plugins directory :

jar ufm <jar_file> additionalAttribute.txt

This additionalAttribute.txt will contain your additional manifest attribute like -

Permissions: all-permissions  
Codebase: *  
Application-Name: My App  
Caller-Allowable-Codebase: *  
Trusted-Library: true
Application-Library-Allowable-Codebase: *

这篇关于如何在没有安全警告的情况下发布 Java Web Start jnlp 应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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