Security Error when running from customer site
Post here questions and problems related to oXygen frameworks/document types.
-
- Posts: 269
- Joined: Sat Jul 10, 2010 4:03 pm
Security Error when running from customer site
Using a self signed certificate.
Java 8_45
Firefox 38.0
I can deploy the applet to my localhost by putting the following in my exception site list and it runs fine. I do get the Security dialog about an untrusted applet.
http://localhost:8080/editor-1/
I'm trying to deploy to http://www.mbepapers.org:8080/editor-1/
Obviously I'm using a tomcat server for both deployments, the editor applet is talking to a JSP server webapp and visa versa using local storage on the clients.
I have both in the exception site list
http://mbepapers.org:8080/editor-1/
http://www.mbepapers.org:8080.editor-1/
Its a very long output in the java console at level 5 output. All the jars pass security except my editor, which originally was oxygen-sample-applet-1.0.....
My generated mbep.jnlp file truncated in the middle for brevity
how I call the applet
I've tried putting the html file name and the jnlp file name in the exception site list but that made no difference.
What am I doing wrong?
Java 8_45
Firefox 38.0
I can deploy the applet to my localhost by putting the following in my exception site list and it runs fine. I do get the Security dialog about an untrusted applet.
http://localhost:8080/editor-1/
I'm trying to deploy to http://www.mbepapers.org:8080/editor-1/
Obviously I'm using a tomcat server for both deployments, the editor applet is talking to a JSP server webapp and visa versa using local storage on the clients.
I have both in the exception site list
http://mbepapers.org:8080/editor-1/
http://www.mbepapers.org:8080.editor-1/
Its a very long output in the java console at level 5 output. All the jars pass security except my editor, which originally was oxygen-sample-applet-1.0.....
later on in the console output here is where it denies running the applet.cache: Cancel delay cleanup: URL: http://www.mbepapers.org:8080/editor-1/ ... APSHOT.jar | /home/scott/.java/deployment/cache/6.0/27/4ee9c91b-1794b401.idx
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@119d10cc: 2
java.lang.SecurityException: JAR manifest application-library-allowable-codebase mismatch for http://www.mbepapers.org:8080/editor-1/ ... APSHOT.jar
at com.sun.deploy.security.DeployManifestChecker.verify(Unknown Source)
at com.sun.deploy.security.DeployManifestChecker.verify(Unknown Source)
at com.sun.javaws.security.AppPolicy.grantUnrestrictedAccess(Unknown Source)
at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResourcesHelper(Unknown Source)
at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResources(Unknown Source)
at sun.plugin2.applet.JNLP2Manager.prepareLaunchFile(Unknown Source)
at sun.plugin2.applet.JNLP2Manager.loadJarFiles(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
basic: null
My default properties for the jnlp sectionpreloader: Delivering: ErrorEvent[url=http://www.mbepapers.org:8080/editor-1/mbep.jnlp label=The Java security settings have prevented this application from running. You may change this behavior in the Java Control Panel. cause=The Java security settings have prevented this application from running. You may change this behavior in the Java Control Panel.
preloader: Enqueue: com.sun.javaws.progress.PreloaderDelegate$4@644285aa
basic: exception: The Java security settings have prevented this application from running. You may change this behavior in the Java Control Panel..
ExitException[ 3]com.sun.deploy.security.BlockedException: The Java security settings have prevented this application from running. You may change this behavior in the Java Control Panel.
at sun.plugin2.applet.JNLP2Manager.prepareLaunchFile(Unknown Source)
at sun.plugin2.applet.JNLP2Manager.loadJarFiles(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
preloader: Preloader shutdown after ErrorEvent
at java.lang.Thread.run(Thread.java:745)
preloader: Stop progressCheck thread queue.size()=0
Ignored exception: ExitException[ 3]com.sun.deploy.security.BlockedException: The Java security settings have prevented this application from running. You may change this behavior in the Java Control Panel.
ui: Show default error panel
Code: Select all
# JNLP
#
#
# The main class to be set in the JNLP file.
mainclass=myGroup.mbepEditorApplet
# The code base to be set in the JNLP file.
#codebase=http://localhost:8080/editor-1/
codebase=http://www.mbepapers.org:8080/editor-1/
Code: Select all
<?xml version="1.0" encoding="UTF-8"?><jnlp spec="1.0+" codebase="http://www.mbepapers.org:8080/editor-1/" href="http://www.mbepapers.org:8080/editor-1/mbep.jnlp">
<!-- The tokens marked with @@ and the DEPENDENCIES element are replaced by Ant/Maven with the correct values-->
<information>
<title>MBEP Editor Applet</title>
<vendor>Mary Baker Eddy Library</vendor>
<homepage href="http://www.mbepapers.org/"/>
<description>MBEP Editor Applet</description>
<description kind="short">Editor</description>
</information>
<security>
<all-permissions/>
</security>
<resources>
<!-- Application Resources -->
<j2se java-vm-args="-Xmx256m -XX:MaxPermSize=80m" version="1.6+"/>
<jar href="lib/mbep-editor-applet-1.0-SNAPSHOT.jar" main="true"/>
<jar href="lib/batik-anim-1.7.jar"/>
<jar href="lib/oxygen-saxon9he-17.0.0.jar"/>
.......
<jar href="lib/oxygen-xercesImpl-17.0.0.jar"/>
</resources>
<applet-desc name="MBEP-Editor-Applet" main-class="myGroup.mbepEditorApplet" width="800" height="600">
</applet-desc>
<update check="always"/>
</jnlp>
Code: Select all
<applet code="myGroup.mbepEditorApplet" width="800" height="600">
<param name="java_arguments" value="-Xmx256m -XX:MaxPermSize=80m"/>
<param name="java_version" value="1.6+" />
<param name="jnlp_href" value="mbep.jnlp" />
<param name="AppletID" value="ApplId" />
<param name="classloader_cache" value="false" />
<param name="separate_jvm" value="true" />
<!--<param name="addHelperViews" value="true"/>
Uncomment the following line for full debug
<param name="loggerLevel" value="debug"/> -->
</applet>
What am I doing wrong?
-
- Posts: 9424
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Security Error when running from customer site
Hi Scott,
This particular error:
would mean that in the main applet JAR library in the Manifest.mf the application-library-allowable-codebase property does not match the code base from where you deploy the applet.
Regards,
Radu
This particular error:
Code: Select all
java.lang.SecurityException: JAR manifest application-library-allowable-codebase mismatch for http://www.mbepapers.org:8080/editor-1/ ... APSHOT.jar
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 269
- Joined: Sat Jul 10, 2010 4:03 pm
Re: Security Error when running from customer site
Radu,
I figured it was something like that.
here is the top portion of the MANIFEST.MF in mbep-editor-applet-1.0-SNAPSHOT.jar, the offending one.
The odd thing is it looks like there is a c/r and a space between "...8080/" and "editor-1/", which I think would be bad?
I checked some of the other jars and they all look the same?
the only place editor-1 is defined is in default.properties
no c/r or space there?
and I assume the MANIFEST.MF is made from the template build-trusted.xml
which uses the same ${codebase} variable the same for for both codebase attributes, yet they are not identical in the output.
So why the c/r and space and does it matter?
I figured it was something like that.
here is the top portion of the MANIFEST.MF in mbep-editor-applet-1.0-SNAPSHOT.jar, the offending one.
Code: Select all
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.2
Application-Name: MBEP Editor Applet
Archiver-Version: Plexus Archiver
Built-By: scott
Permissions: all-permissions
Caller-Allowable-Codebase: http://www.mbepapers.org:8080/editor-1/
Codebase: *
Application-Library-Allowable-Codebase: http://www.mbepapers.org:8080/
editor-1/
Class-Path:
Created-By: Apache Maven
Build-Jdk: 1.8.0_45
Name: myGroup/mbepEditor$19$1.class
SHA-256-Digest: JLv3mv762SNASH2bfggqAWN+bGRiRrHZ3VIq8FJmlVQ=
I checked some of the other jars and they all look the same?
the only place editor-1 is defined is in default.properties
Code: Select all
# JNLP
#
#
# The main class to be set in the JNLP file.
mainclass=myGroup.mbepEditorApplet
# The code base to be set in the JNLP file.
#codebase=http://localhost:8080/editor-1/
codebase=http://www.mbepapers.org:8080/editor-1/
and I assume the MANIFEST.MF is made from the template build-trusted.xml
Code: Select all
<project default="addTrustedLibraries">
<target name="addTrustedLibraryProperty">
<jar file="${jarFile}" update="true">
<manifest>
<!--Commented out, gives warning with Java 1.7.45 -->
<!--<attribute name="Trusted-Library" value="true"/> -->
<!--EXM-27848 Remove warnings, see: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/no_redeploy.html -->
<attribute name="Application-Name" value="MBEP Editor Applet" />
<attribute name="Permissions" value="all-permissions" />
<attribute name="Codebase" value="*" />
<!-- Remove possible dependencies to other jars (not covered by Maven). Avoids unnecessary HTTP requests. -->
<attribute name="Class-Path" value="" />
<!--EXM-28568 Avoid giving warning with Java 1.7.45 -->
<attribute name="Application-Library-Allowable-Codebase" value="${codebase}" />
<attribute name="Caller-Allowable-Codebase" value="${codebase}" />
</manifest>
</jar>
</target>
<target name="addTrustedLibraries" xmlns:ac="antlib:net.sf.antcontrib">
<echo>Processing all jars from: ${project.build.directory}/jnlp/lib</echo>
<ac:foreach target="addTrustedLibraryProperty" param="jarFile">
<path>
<fileset dir="${project.build.directory}/jnlp/lib" includes="**/*.jar, **/*.zip" />
</path>
</ac:foreach>
</target>
</project>
So why the c/r and space and does it matter?
-
- Posts: 269
- Joined: Sat Jul 10, 2010 4:03 pm
Re: Security Error when running from customer site
I see from the manifest spec there is a line length limit
So the broken line looks to be legit? Though it sure is suspicious?Line length:
No line may be longer than 72 bytes (not characters), in its UTF8-encoded form. If a value would make the initial line longer than this, it should be continued on extra lines (each starting with a single SPACE).
-
- Posts: 269
- Joined: Sat Jul 10, 2010 4:03 pm
Re: Security Error when running from customer site
Here is the top portion of the MANEFEST.MF built to run on localhost, which runs fine..
another broken line with a space per the spec.
Code: Select all
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.2
Application-Name: MBEP Editor Applet
Archiver-Version: Plexus Archiver
Built-By: scott
Permissions: all-permissions
Caller-Allowable-Codebase: http://localhost:8080/editor-1/
Codebase: *
Application-Library-Allowable-Codebase: http://localhost:8080/editor-1
/
Class-Path:
Created-By: Apache Maven
Build-Jdk: 1.8.0_45
Name: myGroup/mbepEditor$19$1.class
SHA-256-Digest: +uBoapVWOVzzT4+5M7u7yQvtH+ZwcPVZOR+2LwXdq0E=
-
- Posts: 9424
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Security Error when running from customer site
Hi Scott,
Indeed the line in the properties file is automatically broken if it overflows a number of characters. So that should be OK.
I'm not really sure what the problem is, just for tests could you modify in the build-trusted.xml the values for
Caller-Allowable-Codebase and Application-Library-Allowable-Codebase to be the wildcard * ?
That will probably issue an extra warning at some point but the applet should work.
Regards,
Radu
Indeed the line in the properties file is automatically broken if it overflows a number of characters. So that should be OK.
I'm not really sure what the problem is, just for tests could you modify in the build-trusted.xml the values for
Caller-Allowable-Codebase and Application-Library-Allowable-Codebase to be the wildcard * ?
That will probably issue an extra warning at some point but the applet should work.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 269
- Joined: Sat Jul 10, 2010 4:03 pm
Re: Security Error when running from customer site
Radu,
that did it! There weren’t any additional or changed warnings than I normally get with a self signed applet.
My changes below
the original settings have been commented out with <!-- .... -->
Does this setting allow a less secure environment?
The jnlp still has the codebase set to http://www.mbepapers.org:8080/editor-1/
Scott
that did it! There weren’t any additional or changed warnings than I normally get with a self signed applet.
My changes below
Code: Select all
<!--EXM-28568 Avoid giving warning with Java 1.7.45
<attribute name="Application-Library-Allowable-Codebase" value="${codebase}" />
<attribute name="Caller-Allowable-Codebase" value="${codebase}" /> -->
<attribute name="Application-Library-Allowable-Codebase" value="*" />
<attribute name="Caller-Allowable-Codebase" value="*" />
Does this setting allow a less secure environment?
The jnlp still has the codebase set to http://www.mbepapers.org:8080/editor-1/
Scott
-
- Posts: 9424
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Security Error when running from customer site
Hi Scott,
You can see what each of those manifest parameters means here:
http://docs.oracle.com/javase/7/docs/te ... ifest.html
Regards,
Radu
You can see what each of those manifest parameters means here:
http://docs.oracle.com/javase/7/docs/te ... ifest.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 269
- Joined: Sat Jul 10, 2010 4:03 pm
Re: Security Error when running from customer site
Radu,
that says says
Seems like "lib" should be added to the attribute, no?
The maven script is using the same address for codebase as Application-Library-Allowable-Codebase
Scott
that says says
The way the applet is set up the jnlp file is in the jnlp folder and the jars are in jnlp/lib folder.Application-Library-Allowable-Codebase
...This attribute is used to determine what is listed in the Location field for the security prompt that is shown to users when the JAR file for your RIA is in a different location than the JNLP file or HTML page that starts your RIA...
Seems like "lib" should be added to the attribute, no?
The maven script is using the same address for codebase as Application-Library-Allowable-Codebase
Scott
-
- Posts: 9424
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Security Error when running from customer site
Hi Scott,
Basically * means anything so you can use that.
I'm not sure why setting the value for it does not work for you, in the applet demo we have on our website in the manifest.mf we also have a value like:
and it works for us. But our applet is digitally signed with a valid certificate so there might be also a difference when running it with a self signed certificate.
Regards,
Radu
Basically * means anything so you can use that.
I'm not sure why setting the value for it does not work for you, in the applet demo we have on our website in the manifest.mf we also have a value like:
Code: Select all
Application-Library-Allowable-Codebase: https://www.oxygenxml.com/demo
/AuthorDemoApplet/
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 269
- Joined: Sat Jul 10, 2010 4:03 pm
Re: Security Error when running from customer site
My client is in the process of purchasing the floating license and auth cert. After I get that set up I may put ${codebase} path back in the attribute to see.
I'd rather have the location for the applet locked down.
Scott
I'd rather have the location for the applet locked down.
Scott
Return to “SDK-API, Frameworks - Document Types”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service