Forum Stats

  • 3,853,839 Users
  • 2,264,285 Discussions
  • 7,905,471 Comments

Discussions

Permission + Policy File + Java Applet

2»

Answers

  • EJP
    EJP Member Posts: 32,920 Gold Crown
    I forgot to add that the Jar I will sign is not the Jar which contains my Applet class.
    The Jar I will sign contains MySQL jdbc class.
    No. You need to sign them all.
    EJP
  • 793415
    793415 Member Posts: 7,279 Bronze Badge
    841232 wrote:
    ..I use Eclipse Indigo 3.7
    The reason I asked is that I have a small example of digitally signing an app. at the JNLP API demo. of the File Services. It has an ant build file that creates a self-signed certificate before using it sign the code. Ant build files are easy to import into an IDE. That might give you a start.

    OTOH..
    Now I think I have got enough information to perform a new test.
    ..you do seem to be a motivated learner who takes the initiative. :-)

    BTW - heed EJP's advice and sign all the Jars, it is far less complicated to deploy.
  • 844235
    844235 Member Posts: 13
    My test is done.
    I self-signed my two Jars - the one containing my applet and the one containing the MySQL JDBC ".class" files.
    I uploaded the two self-signed Jars to the web server.
    Then, I loaded my applet through my browser.
    I had to confirm three "Do you trust ..."-like dialogs but at the end I realized that I do not have the permission error anymore :)

    But, at the same time I met another problem.
    My applet does not receive any packets from the MySQL server.
    I wonder if my two self-signed applets can not communicate with a remote machine because it is not the machine where the Jars are located.
    I know that sand-boxed applets can not.

    To Andrew Thomson : Your advice concerning ant build files saved me a lot of time. I created one ant build file via eclipse to automatically generate my Jar and to self-sign my two Jars.
  • DrClap
    DrClap Member Posts: 25,479
    Answer ✓
    841232 wrote:
    But, at the same time I met another problem.
    My applet does not receive any packets from the MySQL server.
    I wonder if my two self-signed applets can not communicate with a remote machine because it is not the machine where the Jars are located.
    I know that sand-boxed applets can not.
    It's equally possible that there is no network path from wherever the applet is running to the MySQL server. (Which in general would be a good thing, because exposing a database server to the Internet can lead to data security problems.)
  • EJP
    EJP Member Posts: 32,920 Gold Crown
    edited Sep 12, 2011 3:37PM
    ... is a data security problem ...
  • 844235
    844235 Member Posts: 13
    You were right guys.
    The web server is a free web host and I read on the official web site that remote connections to the MySQL server are not allowed.
    It is the reason why my applet can not open a connection to the database.

    Anyway, I am going to mark my initial question as answered.
    Self-sign mechanism helped me to get rid of permission problems.
    I thank every person who took some time to give me information via this thread.
This discussion has been closed.