This discussion is archived
4 Replies Latest reply: Mar 27, 2011 5:58 PM by handat RSS

Applet connection to the HTTPS server

849604 Newbie
Currently Being Moderated
Hi all,

I have a problem to access the URL like "https://www.something.com/.../images/100555.png" from the applet.

I use standard methods provided by java.net.URL class ( getContent(), getResponseCode(), etc. ).

When ordinary HTTP protocol is used, there is no problem, but if HTTPS is used, the java.security.AccessControlException: access denied is thrown.

I read web forums and discussions and the problem is something related with certifications, etc, but I don't understand this very much.
Is there any tutorial or guidelines how to develop/implement the applet to be able communicate with HTTPS?

The important way is the applet may not be placed on HTTPS server at all, but it could access its content.

Thank you very much.
  • 1. Re: Applet connection to the HTTPS server
    EJP Guru
    Currently Being Moderated
    Please post the full exception message and stack trace.
  • 2. Re: Applet connection to the HTTPS server
    793415 Pro
    Currently Being Moderated
    EJP wrote:
    Please post the full exception message and stack trace.
    ++

    Is your applet digitally signed and trusted?

    Try your applet with this alternate URL (http://www.pscode.org/media/stromlo2.jpg). Does it behave in the same way?

    I suspect this has nothing to do with secure sites, and everything to do with attempts to access cross-domain resources.
  • 3. Re: Applet connection to the HTTPS server
    849604 Newbie
    Currently Being Moderated
    Complete stack trace is this:

    Exception in thread "Thread-11" java.security.AccessControlException: access denied (java.net.SocketPermission aerowiki.honeywell.com:443 connect,resolve)
         at java.security.AccessControlContext.checkPermission(Unknown Source)
         at java.security.AccessController.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkPermission(Unknown Source)
         at java.lang.SecurityManager.checkConnect(Unknown Source)
         at sun.plugin2.applet.Applet2SecurityManager.checkConnect(Unknown Source)
         at sun.net.www.http.HttpClient.openServer(Unknown Source)
         at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
         at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
         at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
         at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
         at java.net.URLConnection.getContent(Unknown Source)
         at sun.net.www.protocol.https.HttpsURLConnectionImpl.getContent(Unknown Source)
         at java.net.URL.getContent(Unknown Source)
         at hon.supergraph.graphics.IconLoaderManager.loadIconImages(IconLoaderManager.java:60)
         at hon.supergraph.graphics.IconLoaderManager.run(IconLoaderManager.java:128)
         at java.lang.Thread.run(Unknown Source)


    My applet is not digitally signed and trusted and I don't know how I can do that.

    If I try another URL with simple HTTP protocol (http://...), it is OK!

    Thanks again.
  • 4. Re: Applet connection to the HTTPS server
    handat Expert
    Currently Being Moderated
    mamba wrote:
    Exception in thread "Thread-11" java.security.AccessControlException: access denied (java.net.SocketPermission aerowiki.honeywell.com:443 connect,resolve)
    This says it all. You don't have permission to lookup and connect to aerowiki.honeywell.com:443

    Hint: there was a previous message where someone asked you whether your applet was signed and trusted.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points