1

I am currently writing a Java applet (actually JApplet) that uses the Java AWS SDK to download a few files from my S3 bucket. The Applet works very well when I run it on the Applet Viewer in Eclipse, but I run into problems when I try running it on a browser.

I have indeed read a few SO questions on similar issues, but after following the answers provided, I still haven't found a solution to this problem.

At first I tried exporting a runnable jar with all dependencies included, at least for testing. But I got this error message in every browser that I tested in (Firefox, Chrome and IE):

access denied ("java.util.propertyPermission" "com.amazonaws.sdk.disableCertChecking" "read")

After some searching I found that this could be because my jar was not signed. So I self-signed it and tried again only to get the same error. I even decided to work with separate jars instead of packing them into a single jar and sign them all, to no avail.

The AwsCredentials.properties file is current and resides in the same directory as the jars, though I don't think that is what is causing the problem.

The code in HTML that I am using to embed the applet:

<applet code="path.to.class.Packer" 
        archive="signed-packer.jar" 
        width="400px" height="200px">       
</applet>

Let me know if you'd like more information. I'd appreciate any help on this issue. Thank you.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
DaedalusCoder
  • 125
  • 1
  • 4

1 Answers1

1

Yup. An applet running in a browser sandbox is not allowed to read arbitrary Java system properties. It is a security restriction. Signing the applet JAR file should be sufficient, provided that Java accepts the signing certificate. (Have you added your self-signed certificate to your Java installation's keystore?)

Related question: Self-signed applet doesn't get a full permission

Community
  • 1
  • 1
Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
  • I'm not sure of what you mean by adding the certificate to the keystore. I followed this tutorial [here](http://www.java-forums.org/blogs/java-applet/662-how-sign-java-applet.html). A prompt comes up when the applet loads for me to give permission for it to run. – DaedalusCoder Dec 30 '12 at 22:55
  • And do you give it permission? – Stephen C Dec 30 '12 at 23:28
  • I did. I pressed "run" on the dialog. Another one opened later asking if I wanted to block some components for 'security reasons' and I selected no. – DaedalusCoder Dec 30 '12 at 23:42