简体   繁体   English

如何对从Tomcat服务器访问服务的JNLP应用程序进行签名?

[英]How to sign a JNLP application which access the service from a tomcat server?

I am new to security part of any application. 我对任何应用程序的安全性部分都不熟悉。 I have very basic knowledge about digital certificate. 我对数字证书非常基础的知识。 I heard that applications like Applets & Java web start that runs in client machine and access its service from a remote machine needs to digitally signed in-order to perform the activities without any restrictions. 我听说诸如Applets和Java Web启动之类的应用程序在客户端计算机上运行,​​并从远程计算机访问其服务需要进行数字签名,以便无限制地执行活动。

I am having one Java web start application which is not yet signed, shows some security warning each time it is accessed by the users. 我有一个尚未签名的Java Web Start应用程序,每次用户访问它时都会显示一些安全警告。

Following is the details of my Java web start application. 以下是我的Java Web Start应用程序的详细信息。

  1. Application uses Java web-start technology which communicates with the Servlets running on Tomcat7. 应用程序使用Java网络启动技术,该技术与在Tomcat7上运行的Servlet进行通信。
  2. DB is SQL Server 2012. DB是SQL Server 2012。
  3. Server Machine: Windows 64 bit 2008 R2 Enterprise Server. 服务器计算机:Windows 64位2008 R2企业服务器。
  4. Java 7 update 25 64 bit Java 7更新25 64位
  5. All the files(JNLP, jarfiles) needed for the JWS-app and the Web-app is packed as a single war file and deployed to Tomcat7. JWS-app和Web-app所需的所有文件(JNLP,jarfiles)都打包为一个war文件,并部署到Tomcat7。

Can anyone provide some idea for following queries: 任何人都可以为以下查询提供一些建议:

  1. Is signing the jar files in application is only way to avoid the security warning? 是在应用程序中签名jar文件是避免安全警告的唯一方法吗?
  2. Does signing jar file cost? 签署jar文件需要费用吗? Is there any way sign the jars for free? 有什么办法可以免费给罐子签名吗?
  3. Currently the services which runs on Tomcat7 as a JavaEE application is accessed by Web start application through http connection. 当前,Web启动应用程序通过http连接访问在Tomcat7上作为JavaEE应用程序运行的服务。 Do I need to use https instead of http once the jars are signed? 罐子签名后是否需要使用https而不是http?
  4. I found that I need to add the following tag to .jnlp file: <security><all-permissions/></security> 我发现我需要在.jnlp文件中添加以下标签: <security><all-permissions/></security>
  5. Apart from above change is there anything else that I need to make in Java or xml files? 除了上述更改之外,我还需要在Java或xml文件中进行其他操作吗?

显示警告

Note: We are getting some connection reset error for the users who access the application through internet. 注意:对于通过Internet访问应用程序的用户,我们会收到一些连接重置错误。 We notice this error after upgrading the java version from Java5 to Java7. 将Java版本从Java5升级到Java7后,我们会注意到此错误。 Read some where that the security policy has been changed and now downloading unsigned jar files over network has some issue. 请阅读一些已更改安全策略的地方,现在通过网络下载未签名的jar文件存在一些问题。 But not exactly sure whether the error is due to the upgrade to java version or some changes to application code, since we don't have any exceptions in log file other than Connection reset. 但是不能完全确定错误是由于升级到Java版本还是由于对应用程序代码进行了某些更改,因为除了Connection reset之外,日志文件中没有其他例外。

Thanks in advance 提前致谢

The digital signature was generated with an untrusted certificate. 数字签名是使用不受信任的证书生成的。

This is telling. 这说明了。

Is signing the jar files in application is only way to avoid the security warning? 是在应用程序中签名jar文件是避免安全警告的唯一方法吗?

The Jars are apparently already digitally signed, but with an unverified certificate. 罐子显然已经进行了数字签名,但证书未经验证。

An unsigned app. 未签名的应用。 would have a different warning (and Oracle has warned that in future, they will be defaulting the JVM to not run them at all). 将会有不同的警告(Oracle警告说,将来,他们将默认使用JVM使其完全不运行)。

An app. 一个应用程序。 signed with a verified certificate will produce much the same warning as you are currently seeing, except the 'Publisher:' would be listed, and if the user ticks 'always allow' (which apparently no longer appears on self signed or unsigned code), the JRE will store and remember that decision. 使用经过验证的证书签名的用户将产生与您当前看到的警告几乎相同的警告,除了会列出“发布者:”,并且如果用户勾选“始终允许”(显然不再出现在自签名或未签名的代码上), JRE将存储并记住该决定。

Does signing jar file cost? 签署jar文件需要费用吗? Is there any way sign the jars for free? 有什么办法可以免费给罐子签名吗?

The answer to the second question is 'how much does it cost you now?' 第二个问题的答案是“现在要花多少钱?” The answer to the first is 'yes'. 第一个答案是“是”。

Currently the services which runs on Tomcat7 as a JavaEE application is accessed by Web start application through http connection. 当前,Web启动应用程序通过http连接访问在Tomcat7上作为JavaEE应用程序运行的服务。 Do I need to use https instead of http once the jars are signed? 罐子签名后是否需要使用https而不是http?

No. 没有。

I found that I need to add the following tag to .jnlp file: <security><all-permissions/></security> Apart from above change is there anything else that I need to make in Java or xml files? 我发现我需要在.jnlp文件中添加以下标签: <security><all-permissions/></security>除了上述更改之外,我还需要在Java或xml文件中进行其他操作吗?

I doubt you need to specify that. 我怀疑您需要指定。 Even a sand-boxed app. 甚至是沙盒应用。 can 'phone home' to the same server. 可以“打电话回家”到同一台服务器。 If digitally signed using a trusted certificate, the warnings will be more mild. 如果使用受信任的证书进行数字签名,则警告将更加温和。


One thing you need to keep uppermost in your mind, is that all this security is not for the convenience of the developer, but the safety of the end user (and user confidence in the plug-in). 您需要牢记的一件事是,所有这些安全性并不是为了开发人员的方便,而是最终用户的安全(以及用户对插件的信心)。 So when you try to find 'room to squirm out of it' you are effectively trying to find security bugs in the JRE. 因此,当您尝试查找“腾出空间”时,实际上是在尝试查找JRE中的安全错误。

If you do find one, please let us know so we can raise a high priority bug report with Oracle, and get it fixed. 如果您找到了,请告诉我们,以便我们向Oracle提出高优先级的错误报告,并将其修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM