Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Security / May 2004

Tip: Looking for answers? Try searching our database.

RSA Signed Applet still throws SocketException

Thread view: 
SPG - 27 May 2004 18:47 GMT
Hi,

We have an applet that is signed using an RSA key.
It used to work fine apparently but I cannot get it to work.

When the socket attempts to connect, we get the following exception:

Error: access denied (java.net.SocketPermission 127.0.0.1:0 connect,resolve)

Now, We also have an MS JVM version of this applet, also signed and this
works fine. I am using the standard Java Plugin from the SUN site for the
*real* java version of the applet, but to my dismay this is the version that
does not work!!

We get the "Accept Certificate" banner when the applet loads, and we accept
the cert, and bang.. Exception heaven.

Now, we are using APPLET tags in our HTML. I am not sure if we need to use
the cruddy OBJECT wrapper for MS IE?? Other than that I am stumped.

Help me please!

Steve
Roedy Green - 28 May 2004 03:26 GMT
>Now, we are using APPLET tags in our HTML. I am not sure if we need to use
>the cruddy OBJECT wrapper for MS IE?? Other than that I am stumped.

It is not that.  Check the tags with
http://mindprod.com/jgloss/applet.html

They work fine with signed Applets.

I have several.

Signature

Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.

SPG - 28 May 2004 13:05 GMT
Hi Roedy.

I saw another thread in the 'talk about programming' network that you
answered  to FB.

He was saying that he has a couple of threads that are spawned and the code
that checks permissions is on the threads. These fail.

This got me thinking. I the two calls to create sockets that are failing in
my applet's main class, under the start() method. Guess what? They worked.

Now, I have a couple of threads that are started and make connections to a
server. These are failing. Even though the applet is signed correctly.

I have also read that classes must be assigned to a CodeBase that a policy
will cover. With a signed app I just assumed all code was covered for all
things.

So, my question is, The threading issue, is that a red herring? Or must I
handle the policies for each one?

I am getting a bit stuck here!

Steve

PS: The calls I make are:

1)
Socket o_Sock = new Socket(o_URL.getHost(), o_URL.getPort());

2)
SecurityManager o_SecurityManager = System.getSecurityManager();
    if (o_SecurityManager!=null){
     o_SecurityManager.checkConnect("127.0.0.1",0); //Works in main
class!!!
    }

> >Now, we are using APPLET tags in our HTML. I am not sure if we need to use
> >the cruddy OBJECT wrapper for MS IE?? Other than that I am stumped.
[quoted text clipped - 5 lines]
>
> I have several.
Roedy Green - 28 May 2004 19:56 GMT
>I am getting a bit stuck here!

I repeat. Show us the code, at least the line that is giving the
trouble, and tell us the values of the relevant variables.

I said I don't think this has anything to do with permisssions at all.
You asked to connect to a non-existent socket.

Signature

Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.

SPG - 28 May 2004 17:34 GMT
OK, Found the problem.
Our applet is compiled using J++, which of course is a bad bad thing.
It is riddled with conditional compile options for SUN_JVM versions..

Then I realised that I am running a fiarly new verion of the JRE/JVM from
sun which of course changed the way they manage security.

Rolled back to 1.4.1nnn of the JRE and it all works!

My next task is to rip out all the conditional stuff and build a version
that works with both SUN and MS JVMs - probably on separate instances I
guess.

Hey ho..

Steve

> >Now, we are using APPLET tags in our HTML. I am not sure if we need to use
> >the cruddy OBJECT wrapper for MS IE?? Other than that I am stumped.
[quoted text clipped - 5 lines]
>
> I have several.
Roedy Green - 28 May 2004 19:58 GMT
>My next task is to rip out all the conditional stuff and build a version
>that works with both SUN and MS JVMs - probably on separate instances I
>guess.

At this point, just tell people who are using that old JVM to upgrade
if they want to play. It makes life too difficult jumping through
hoops for that JVM even Microsoft has disowned.

Signature

Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.