Java Applet from IE - SecurityException connection error

Harmen van der Wal harmen.wal "at"
Fri, 08 Jun 2001 15:53:51 +0000

Tony Lin wrote:
> Hello all,
> I am using the update versions from "". When I use Java
> Applet from IE or Netscape to connect to a PC(windows 2000), it has an error
> message " sedurity.SecurityExcepionEx[rfbProto.<init>]: cannot access
> "". 5900". Can someone tell me how to solve this problem? But it
> works fine from VNCWindow or Dos windows by running command:

I suppose the applet is not hosted on A (sandboxed)
applet can only connect back to its origin host.

> C:\1 x\New Folder\tightvnc-1.1p9_javabin\classes>java vncviewer HOST
> PORT 5900

Java applications have an easier security policy than applets.

> Here is the HTML page that I used to connect the PC with the connection
> <html>
>   <head>
>       <title>VNCviewer</title>
>   </head>
>   <body>
>       <h1>VNCviewer for eValid</h1>
>       <hr>
>       <applet codebase="." applet code="vncviewer.class"
> ARCHIVE=vncviewer.jar WIDTH=800 HEIGHT=600>
>   <param name="HOST" value="">
>   <param name="PORT" value="5900">
>   <param name="Encoding" value="evalid">
>   <param name="Use CopyRect" value="Yes">
>   <param name="Mouse buttons 2 and 3" value="Normal">
>   <param name="Raw pixel drawing" value="Reliable">
>   <param name="CopyRect" value="Fast">
>   <param name="Share desktop" value="Yes">
>   </body>
> </html>

It seems you crafted your own html. That's OK, but if HOST is not
the applets origin host (like in the applets codebase), you will
get the security exception. BTW it is not important where the
html document is located.

You could look into setting an easier security policy for this
particular applet (maybe signing it). You could also use a simple
TCP/IP redirector on the host where the applet is hosted. Or
maybe you could just host the applet on the vncserver host, using
VNC's own httpd, putting the HTML document wherever you like.

To unsubscribe, send a message with the line: unsubscribe vnc-list
to majordomo "at"
See also: