webstart icon indicating copy to clipboard operation
webstart copied to clipboard

After sign all the jars run launch.jnlp shows jar resources in jnlp are not signed by same certificate

Open alterhu2020 opened this issue 9 years ago • 3 comments

the maven content is:

` true

                        <codebase>${application.url}</codebase>
                        <workDirectory>${application.directory}</workDirectory>
                        <!-- Set to true to exclude all transitive dependencies. Default is 
                            false. -->
                        <excludeTransitive>false</excludeTransitive>
                        <outputJarVersions>false</outputJarVersions>
                        <canUnsign>true</canUnsign>
                        <unsign>true</unsign> <!-- unsign already signed packages and sign them with own key -->

                        <unsignAlreadySignedJars>true</unsignAlreadySignedJars>
                        <verifyjar>true</verifyjar>
                        <makeArchive>false</makeArchive>

                        <libPath>libs</libPath>
                        <dependencies>
                            <!-- Note that only groupId and artifactId must be specified here. 
                                because of a limitation of the Include/ExcludesArtifactFilter -->
                            <includes>
                                <include>com.github.becausetesting:commons</include>
                                <include>com.jgoodies:jgoodies-common</include>
                                <include>com.jgoodies:jgoodies-looks</include>
                                <include>com.jgoodies:jgoodies-forms</include>
                                <include>com.miglayout:miglayout-core</include>
                                <include>com.miglayout:miglayout-swing</include>
                                <include>log4j:log4j</include>
                                <include>net.sourceforge.jtds:jtds</include>
                                <include>net.java.dev.jna:jna</include>
                                <include>net.java.dev.jna:jna-platform</include>
                            </includes>
                        </dependencies>
                        <sign>
                            <keystore>${application.directory}/KeyStore_${timestamp}</keystore>
                            <keypass>YourPassword</keypass>
                            <storepass>YourPassword</storepass>
                            <alias>WebStartJNLP</alias>
                            <storetype>jks</storetype>

                            <validity>3650</validity>

                            <dnameCn>Alter Hu</dnameCn>
                            <dnameOu>Becausetesting</dnameOu>
                            <dnameO>GitHub</dnameO>
                            <dnameL>Shanghai</dnameL>
                            <dnameSt>Shanghai</dnameSt>
                            <dnameC>US</dnameC>

                            <verify>true</verify>
                            <keystoreConfig>
                                <delete>true</delete>
                                <gen>true</gen>
                            </keystoreConfig>
                        </sign>
                        <jnlp>
                            <inputTemplate>template.vm</inputTemplate>
                            <version>1.0</version>
                            <spec>1.0+</spec>
                            <href>${application.jnlpname}</href>
                            <allPermissions>true</allPermissions>
                            <j2seVersion>1.6+</j2seVersion>
                            <offlineAllowed>true</offlineAllowed>
                            <outputFile>${application.jnlpname}</outputFile>
                            <mainClass>${application.mainclass}</mainClass>
                        </jnlp>


                    </configuration>

`

Then take to run the built jnlp file ,it shows below error. JNLPException[category: Launch File Error : Exception: null : LaunchDesc: <jnlp spec="1.0+" codebase="http://localhost:9999/commons-window-jnlp/jnlp" href="launch.jnlp"> <information> <title>commons-window</title> <vendor>Alter Hu</vendor> <homepage href="https://github.com/becausetesting/commons-window"/> <description>A common libraries used for windows framework.</description> <description kind="short">A common libraries used for windows framework.</description> <description kind="one-line">A common libraries used for windows framework.</description> <description kind="tooltip">A common libraries used for windows framework.</description> <icon href="images/splash.png" width="48" kind="default"/> <icon kind="splash" href="images/splash.png" width="128" height="128"/> <shortcut online="true"> <desktop/> <menu submenu="commons-window"/> </shortcut> <offline-allowed/> </information> <security> <all-permissions/> </security> <update check="background" policy="always"/> <resources> <java version="1.6+" href="http://java.sun.com/products/autodl/j2se" java-vm-args="-ea" initial-heap-size="128m" max-heap-size="512m"/> <jar href="commons-window-1.0.0.jar" main="true"/> <jar href="libs/jgoodies-common-1.8.1.jar"/> <jar href="libs/jgoodies-looks-2.7.0.jar"/> <jar href="libs/jgoodies-forms-1.9.0.jar"/> <jar href="libs/miglayout-core-5.0.jar"/> <jar href="libs/miglayout-swing-5.0.jar"/> <jar href="libs/commons-1.1.0.jar"/> <jar href="libs/log4j-1.2.17.jar"/> <jar href="libs/jtds-1.3.1.jar"/> <jar href="libs/jna-4.1.0.jar"/> <jar href="libs/jna-platform-4.1.0.jar"/> </resources> <application-desc main-class="com.github.becausetesting.commonswindow.CommonsWindowSample" download="eager"/> </jnlp> ] at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResourcesHelper(Unknown Source) at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResources(Unknown Source) at com.sun.javaws.Launcher.prepareResources(Unknown Source) at com.sun.javaws.Launcher.prepareAllResources(Unknown Source) at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source) at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source) at com.sun.javaws.Launcher.launch(Unknown Source) at com.sun.javaws.Main.launchApp(Unknown Source) at com.sun.javaws.Main.continueInSecureThread(Unknown Source) at com.sun.javaws.Main.access$000(Unknown Source) at com.sun.javaws.Main$1.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

alterhu2020 avatar Jun 16 '16 06:06 alterhu2020

as mention here in this page : http://stackoverflow.com/questions/19481826/java-7u51-will-not-accept-jnlp-with-self-signed-certificate ,is that meaning self-signed -certificate not worked in this plugin ?

alterhu2020 avatar Jun 16 '16 07:06 alterhu2020

I'm seeing this same issue but I'm not using a self-signed certificate, I'm using an official signing cert from DigiCert. I unpacked the assembly I'm creating and every jar is signed with my cert. Any ideas what else could be causing this?

RangerRick avatar Nov 01 '16 14:11 RangerRick

We have this any time we have to renew our cert, since our app doesn't change a lot. Most of the dependency jar versions don't change, but since we're using the jnlp-download-servlet goal, it puts all the specific versions of the jars in. When webstart downloads, it sees that the versions haven't changed, even though the web server resources are newer (re-signed) and skips over them. So you end up with new jars for your build that are signed by the new cert, and the existing, version-stable jars that are signed (in the cache) by the old one.

mattpangaro avatar Apr 12 '19 14:04 mattpangaro