• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Security manager and local connection

 
Amund Frislie
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could anyone help me with the following problem:
When starting "my" application, a "connection GUI" appears where the user can select either remote or local connection. For the local connection, the user can also select which file to fetch data from. For the remote connection, the user can choose server name, port number and security manager policy file. All well so far (I think . Imagine the following scenario: The user tries to connect remotely, but fails (the server could be unavailable). He then tries to connect locally. However, the attempt to remotely connect has already set up a SecurityManager which prevents the local client to connect to the local data class (or access the local file system, for that sake). A solution to this could be to make the user always start the application with the -Djava.security.policy argument, even though he only wants to connect locally, and then remove the possibility to set policy file in the GUI. The other options would still be set in the GUI. Would this be an acceptable solution? Should I make the user set *all* properties using the command-line?
Cheers,
Amund
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I used the -Drmi.security.policy when I start the server, and when I start the client in Remote mode. In local mode I do not use this.
I found it easier that way.
And I only instantiated an RMISecurityManager just before a client looks up the Object in the RMI Registry.
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic