Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

explain java security in detail

Status
Not open for further replies.

pollux0

IS-IT--Management
Mar 20, 2002
262
US
I am trying to understand in detail how java applet security works regarding network connections.
From what I know an applet will only connect to the host it originally came from. Correct?

In the code of the applet, what would i specify as the ipaddress to connect to?

The problem: My server has two ip adrresses: 5.5.5.1 and 5.5.5.2 . 5.5.5.1 is used to listen for web requests on port 80. It is also the location for the java applet for the client.

We want the java server to to listen on 5.5.5.2, port 80. It is on the machine but on a different ip.

Can anyone explain?
 
See the documentation for java.applet.Applet.getDocumentBase()

-pete
 
>> what would i specify as the ipaddress to connect to?

Use the data returned to obtain the "address" to connect to, right?


-pete
 
>>>> In the code of the applet, what would i specify as the ipaddress to connect to?

Because java.applet.Applet.getDocumentBase() gives you the base for the Applet - ie the IP from which the applet lives.


When you say :
>>>>> "The problem: My server has two ip adrresses: 5.5.5.1 and 5.5.5.2 . 5.5.5.1 is used to listen for web requests on port 80. It is also the location for the java applet for the client.

We want the java server to to listen on 5.5.5.2, port 80. It is on the machine but on a different ip.
&quot; <<<<<<

port 80 is the default address at which a web server listens for HTTP requests - so I am not understanding what you mean by &quot;want the java server to to listen on 5.5.5.2, port 80. &quot;

What do you mean by &quot;java server&quot; ? Applets can communicate with any server they like, as long as security is set appropriately.

Take a look at
 
sorry for the confusion...

many companys block outgoing ports. hence if our java program, i.e. &quot;chat server&quot;, listens to port 7070, it could potentially be blocked. I want to set up the java program, i.e. &quot;chat server&quot;, to listen on port 80 so it will not be blocked.

the problem is the web server is already listening on port 80 of ip address 5.5.5.1, (I/O error). I want to add the ip address 5.5.5.2 to my server and have the java program, i.e. &quot;chat server&quot; listen on 5.5.5.2:80.

>What do you mean by &quot;java server&quot; ? Applets can communicate >with any server they like, as long as security is set >appropriately.

I mean the java program that acts as the server.
 
If you already have something using port 80, then you cannot open a ServerSocket on this port. If you are running apache httpd server, then you can configure a servlet container such as Tomcat to take requests for certain URLs - you may want to look at the documentation - jakarta.apache.org
 
pollux0
>> many companys block outgoing ports.

Yes, but to do cross domain access from the users browser running your applet the applet must be signed which means the user will have to accept the applet as trusted. So you really cannot circumvent the security concerns without the users knowledge. That would be a huge hole in the security design right?

If going the route of the signed applet is acceptable go here: java.sun.com/security


-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top