• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reg:Socket security exception

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear all,

I've written an applet running in a webpage, which will open a socket connecting to 127.0.0.1, the localhost.

It work fine in my development environment (browser & webserver run in localhost), but when I deploy the website to a server,the applet always run with exception "access denied (java.net.SocketPermission 127.0.0.1:20000 connect,resolve)".

I've have signed the jar with a cert. I have changed the java.policy in system to allow it, but still it didnt work.

The grant permission that i gave is :



kindly provide me a solution.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the applet is signed then no policy change is needed - those are two different ways to accomplish the same thing. Are you getting the dialog that asks you whether you want to trust the certificate?

You may have to run the code as privileged code, as described in https://coderanch.com/how-to/java/HowCanAnAppletReadFilesOnTheLocalFileSystem.
 
rajesh anguraj
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am getting the dialog for trust certificate. The problem is i am calling the applet method through a javascript call. I feel this might be causing the problem.
 
The overall mission is to change the world. When you've done that, then you can read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic