Java 7 更新 51 的 Java Web Start 安全对话框 [英] Java Web Start security dialogs with Java 7 update 51

查看:23
本文介绍了Java 7 更新 51 的 Java Web Start 安全对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我构建了一个使用有效证书签名的 Java Web Start 应用程序.

I build a Java Web Start application signed with a valid certificate.

当我启动应用程序时,安全对话框正确显示,如图所示

When I star the application the security dialog appear correctly as show in this figure

http://www.java.com/en/img/download/trusted_signed.jpg

我的问题是关于不再显示"复选框.

My issue is about the "do not show again" checkbox.

如果属性 href 存在于 jnlp 文件的 jnlp 标记中,则复选框出现.

If the attributes href are present in the jnlp tag of the jnlp file the checkbox appear.

如果属性不存在,则不会出现复选框,每次运行都需要确认.

If the attribute are not present, the checkbox doesn't appear and the run needs to be confirmed every time.

(例如:<jnlp spec="1.0+" codebase="http://docs.oracle.com/javase/tutorialJWS/samples/deployment/webstart_ComponentArch_DynamicTreeDemo" href="dynamictree_webstart.jnlp">

(Example: < jnlp spec="1.0+" codebase="http://docs.oracle.com/javase/tutorialJWS/samples/deployment/webstart_ComponentArch_DynamicTreeDemo" href="dynamictree_webstart.jnlp">

)

这是一个问题,因为我的 jnlp 文件位于受密码保护的目录下,如果指定了 href,Java Web Start 应用程序会尝试将其作为其他资源进行检索.(导致访问被拒绝,因为只有浏览器会话通过身份验证,运行失败)

This is a problem because my jnlp file is under a password protected directory and if href is specified, the Java Web Start application try to retrieve it as the other resources. ( result in access denied because only the browser session is authenticated and the run fails)

部署 Java Web Start 应用程序中的文档说:

The documentation at Deploying a Java Web Start Application said:

在部署至少在 Java SE 6 update 18 或更高版本上运行的 Java Web Start 应用程序时,codebase 和 href 属性是可选的.在部署将与 Java 运行时环境软件的先前版本一起运行的 Java Web Start 应用程序时,您必须指定 codebase 和 href 属性.

The codebase and href attributes are optional when deploying Java Web Start applications that will run on at least the Java SE 6 update 18 release or later. You must specify the codebase and href attributes when deploying Java Web Start applications that will run with previous releases of the Java Runtime Environment software.

正确的代码是什么?带href还是不带?

What is the right code? With href or without?

这是BUG还是功能?

如何在无需指定 href 属性的情况下显示不再显示"复选框?

How can I show the "don't show again" checkbox without having to specify the href attribute?

推荐答案

经过大量搜索和测试后,我们发现 Java Web Start 应用程序只有这两种方式,并由受信任的第三者正确签名派对证书,将在 JRE 1.7.0_51 & 下部署显示预期的安全对话框(带有不再显示..."复选框):

After much searching and testing we've found only these two ways for a Java Web Start app, properly signed with a trusted 3rd party cert, to be deployed under JRE 1.7.0_51 & display the expected Security dialog (with "Do not show this again..." check-box):

1) 添加 href= 与上面描述的启动文件自引用,例如:

1) Add href= with the launch file self-reference as you describe above, e.g:

jnlp spec="1.0+" codebase="http://some.dn.com/OurAppHome/"  href="launch.jnlp"

对于通过 ASP 或在您上面提到的其他条件下生成 JNLP 的网站来说,这不是直接的.

Which is not straight forward for sites that generate the JNLP through, say ASP, or under other condtions like you note above.

2) 正确的做法:JAR 清单使其在控制台日志中不显示缺少 Blah-Blah-Blah 清单属性.我们发现的 7u51 的最少附加清单属性必须存在(*s 作为测试值):

2) The proper thing: JAR manifest such that it shows no Missing Blah-Blah-Blah manifest attribute in console log. The minimal additional manifest attributes for 7u51 we've found must be present (*s as test values):

Permissions: all-permissions
Codebase: *
Application-Library-Allowable-Codebase: *

所以我们工作的完整构建脚本测试清单看起来像这样(生成版本):

So our working full build script test manifest looks something like this (version is generated):

         <manifest>
             <attribute name="Application-Name" value="Our App Name"/>
             <attribute name="Main-Class" value="com.whatever.main.AppLoader"/>
             <attribute name="Class-Path" value="./Corejar.jar ./Support.jar"/>
             <attribute name="Built-By" value="${user.name}"/>
             <attribute name="Permissions" value="all-permissions"/>
             <attribute name="Codebase" value="*"/>
             <attribute name="Application-Library-Allowable-Codebase" value="*"/>
             <attribute name="Trusted-Only" value="true"/>
             <attribute name="Specification-Title" value="Our App Name"/>
             <attribute name="Specification-Version" value="${version}"/>
             <attribute name="Specification-Vendor" value="Our Company Name"/>
         </manifest>

这篇关于Java 7 更新 51 的 Java Web Start 安全对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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