Security, SocketPermission and applets

Hi, Im trying to read an url from an applet but I dont know how to set the permissions from the applet.
here is my code:
import java.applet.*;
import java.net.*;
import java.io.*;
import java.awt.*;
public class TestApplet extends Applet{
private String line;
public void init () {
try {
URL url = new URL(
"http://www.yahoo.com");
BufferedReader in = new BufferedReader(
new InputStreamReader(url.openStream()));
line = in.readLine();
in.close();
}catch (Exception e){
e.printStackTrace();
public void paint (Graphics g) {
g.drawString (line, 20, 40);
And the problems are here:
java.security.AccessControlException: access denied (java.net.SocketPermission w
ww.yahoo.com resolve)
at java.security.AccessControlContext.checkPermission(AccessControlConte
xt.java:270)
at java.security.AccessController.checkPermission(AccessController.java:
401)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:542)
at java.lang.SecurityManager.checkConnect(SecurityManager.java:1042)
at java.net.InetAddress.getAllByName0(InetAddress.java:937)
at java.net.InetAddress.getAllByName0(InetAddress.java:918)
at java.net.InetAddress.getAllByName(InetAddress.java:912)
at java.net.InetAddress.getByName(InetAddress.java:832)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:293)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:264)
at sun.net.www.http.HttpClient.New(HttpClient.java:336)
at sun.net.www.http.HttpClient.New(HttpClient.java:317)
at sun.net.www.http.HttpClient.New(HttpClient.java:312)
Does anybosy knows how can i fix this program so it can work?
Thank you

In order to access anything in client machine u have sign ur applications.
Signing JAR Files with a Test Certificate
Here are the steps needed to sign a JAR file with a test certificate:
1. Make sure that you have a JDK 1.2 or JDK 1.3 keytool and jarsigner in your path (located in the J2SE SDK bin directory).
2. Create a new key in a new keystore as follows:
keytool -genkey -keystore myKeystore -alias myself
You will get prompted for a information about the new key, such as password, name, etc. This will create the myKeystore file on disk.
3. Then, create a self-signed test certificate as follows:
keytool -selfcert -alias myself -keystore myKeystore
This will prompt for the password. Generating the certificate takes a few minutes.
4. Check to make sure that everything is ok. To list the contents of the keystore, use the command:
keytool -list -keystore myKeystore
It should list something like:
Keystore type: jks
Keystore provider: SUN
Your keystore contains 1 entry:
myself, Tue Jan 23 19:29:32 PST 2001, keyEntry,
Certificate fingerprint (MD5):
C2:E9:BF:F9:D3:DF:4C:8F:3C:5F:22:9E:AF:0B:42:9D
5.Finally, sign the JAR file with the test certificate as follows:
jarsigner -keystore myKeystore test.jar myself
6. Repeat this step on all of your JAR files.
Please note that a self-signed test certificate should only be used for internal testing, since it does not provide any guarantees about the identity of the user and therefore cannot be trusted. A trust-worthy certificate can be obtained from a certificate authority, such as VeriSign, and should be used when the application is put into production.
Regards
Edward.i

Similar Messages

  • How to establish communication between dynpro and Applet running in Portal

    Hello SDN,
    I have a problem with concept of my app and would be glad if You can help me. 
    -  I needed a graphics engine to draw a map during a dynpro runtime, and i made applet for it because dynpro don't offer suitable api.
    Map have to show some data from Bussines Warehouse and R/3 and also have to return coordinates onMouse click to dynpro app.
    My question is how to pass params from web dynpro app to applet and receive coordinates after mouse click on map.
    I made dynpage and placed my applet inside for EPCF but don't know how to use it in applet?

    1. First of all set up the Rfc connection between System A and System B.
       If you are calling the function module which is avlaible on Syetem A  and calling in system B. In system A, go to SM59 opt for R\3 connection and give all the details in "Technical settings" and "logon & Security" tabs and test your connection. If you are returning any value Back to system A , make the same settings in system B.
    2. While creating the Function module check the Radio-button "Remote-Enabled Module" in the attributes tab.
    3. Call function <function-name> Destination <Destination-name>.

  • JDBC and Applet communication

    HI!
    I am not able to connect my Oracle datbase in Applet.
    Please give ur suggestions.
    Thanx in Adv
    Vink

    Hi
    An applet can request a socket connection only to the server from which it is downloaded from.
    If your database and the webserver are running on different hosts then the applet security model restricts the applet from connecting to the database. You need to set the proper security policies and sign the applets.
    Refer the following link on applets
    http://developer.java.sun.com/developer/technicalArticles/Security/Signed/
    Also post the complete error/stack traces if you get into some problems.
    Hope this helps
    shrini

  • Secure Copy and Paste in Sandboxed mode

    Hi,
    while working on copy-and-paste of mathematical formulae for our ActivMath learning environment, a web-based one, I, of course, chopped to the problem that sandboxes (be them in Java applets, JNLP, JavaScript, Flash, ...) refuse the access to the clipboard.
    That's partially survivable thanks to drag-and-drop...
    I realized, however, that the class TransferHandler could be easily adapted to allow a secure copy and paste that would not touch, itself, the system-clipboard hence, should be allowed to sandboxes:
    - a copy action can be requested using standard gestures. In a browser, this includes the browser's copy menu-item and related shortcut. In many native components, the shortcut is actually working. Such an action would then trigger trusted code and invoke the handler's createTransferable method and put it into the clipboard.
    - similarly a paste action can be requested using standard gestures and invoke the importData method.
    Can anyone tell me how insecure that would be ?
    thanks
    paul
    http://www.activemath.org/~paul/

    So... anybody?

  • Security issues with Applets

    I have a web server that has access to a database server as i am able to create web pages with ASP and connect to the database fine using a DSN, i have created a web page that contains an applet, the applet attempts to connect to the database but i get a security error, how do i overcome this security issue, the sucurity error looks like this:
    Exception: java.security.AccessControlException: accessdenied(java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc)
    Can anyone help??

    There is a java.policy file in
    C:\Program Files\JavaSoft\JRE\1.3.1\lib\security\java.policy
    And a tool you can use in
    C:\Program Files\JavaSoft\JRE\1.3.1\bin\policytool.exe
    You might have to tell the policytool.exe where to open the java.policy file.
    You can also just modify it in a text editor and save it as plain text when you are done.
    I don't know which permission you should look for, but you can try with
    grant {
    permission java.security.AllPermission;
    and remove or comment out the other lines. Make a backup of the policy file before you try it. Restart the browser.
    Note that you have to do this on all client machines that wants to run your applet.

  • Creating Standalone and applet applications

    Hi,
    I have created a standalone app, but what i want to do is convert this, so that it can be an applet, or a standalone app dependant on from where it is run.
    My app adhears to all security restrictions fro applets, and uses swing to create the gui.
    Many thanks for any help

    Thanks a lot, tried searching everywhere to no avail. That code should give me something to work on when i get home
    Many thanks for your help

  • An alert message pops up upon opening saying could not initiate application security component, and it says to check to see if profile has no read/write restrictions.

    An alert message pops up upon opening saying could not initiate application security component, and it says to check to see if profile has no read/write restrictions. Than when it opens all of my saved passwords are gone, I use a master password and its disabled. When I try to enter in a new on e it says can't change password. I can't even open yahoo e-mail says that my ssl security is down but when I check it its clicked. I'm just very confused as to whats going on.
    == This happened ==
    Every time Firefox opened
    == 5/14/2010 ==
    == User Agent ==
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.1.249.1064 Safari/532.5

    See [[Could not initialize the browser security component]]
    Rename (or delete) secmod.db (secmod.db.old) in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Profile Folder] in case there is a problem with the file.

  • I have no "Rescue email" contact in order to reset my security questions and I don't believe I ever answered any security questions when I created my Apple ID for Itunes.  Someone kindly sent me Apple support link but to no avail!  Please Help me!

    I have no "Rescue email" contact in order to reset my security questions!!  I've been trying now for 4 days to contact Apple/Itunes but I only get sent answers from a support team that say they cannot help me with my problem!! 
    The thing is that I can't ever remember answering any security questions and without a rescue email, I'm unable to reset them or even set them for the first time!!
    I can't believe that no-one from Apple/Itunes can help me with this simple problem but unfortunately that is the case - Incredible, isn't it!!!
    Would anyone know how I could solve this problem online???   Because each time I sign into Itunes, the same security questions reappear and reappear and reappear.  In fact I've got to the point where I feel like uninstalling Itunes and downloading an alternative.
    Many thanks

    You need to ask Apple to reset your security questions; this can be done by clicking here and picking a method, or if your country isn't listed, filling out and submitting this form.
    They wouldn't be security questions if they could be bypassed without Apple verifying your identity.
    (111154)

  • My iPod wont let me buy any apps becomes it needs the answers to my security question and I forgot the password and it won't send the email what do I do

    Please can someone help me

    From a Kappy  post
    The Three Best Alternatives for Security Questions and Rescue Mail
    Try # 2
       1. Use Apple's Express Lane.
    Go to https://expresslane.apple.com ; click 'See all products and services' at the
    bottom of the page. In the next page click 'More Products and Services, then
    'Apple ID'. In the next page select 'Other Apple ID Topics' then 'Forgotten Apple
    ID security questions' and click 'Continue'. Please be patient waiting for the return
    phone call. It will come in time depending on how heavily the servers are being hit.
    2.  Call Apple Support in your country: Customer Service: Contact Apple support.
    3.  Rescue email address and how to reset Apple ID security questions.
    A substitute for using the security questions is to use 2-step verification:
    Two-step verification FAQ Get answers to frequently asked questions about two-step verification for Apple ID.

  • I am trying to use my account to purchase but i forget my security questions and also i gave the wrong email address. What can i do?

    i am trying to use my account to purchase but i forget my security questions and also i gave the wrong email address. What can i do?

    Apple ID security issues -
    Call Apple Care and ask for the Account Security Team. They can assist you with your issue.

  • I got a new iPhone and i am trying to buy songs but when I go to buy a song on iTunes it says I have to answer my security questions and I don't remember the answers. I pressed where it says for them to email you your answers but I haven't gotten an email

    I got a new iPhone and i am trying to buy songs but when I go to buy a song on iTunes it says I have to answer my security questions and I don't remember the answers. I pressed where it says for them to email you your answers but I haven't gotten an email.  Is there another way to change or get the answers for the security questions?

    If the email hasn't arrived after a few hours and isn't in a spam filter, you need to ask Apple to reset your security questions; this can be done by phoning AppleCare and asking for the Account Security team, or clicking here and picking a method, or if your country isn't listed in either article, filling out and submitting this form.
    They wouldn't be security questions if they could be bypassed without Apple verifying your identity.
    (106007)

  • I forgot all of the answers to my security questions and when I set up my apple id I did not add a rescue email, I recently got a new iphone and I cannot purchase anything on it because it asks me to answer my security questions which i can't reset, help!

    I forgot all of the answers to my security questions and when I set up my apple id I did not add a rescue email, I recently got a new iphone and I cannot purchase anything on it because it asks me to answer my security questions which i can't reset because I do not have a rescue email. what do I do?

    this does not help. I have forgotten ALL of the answers to my security questions. I can NOT reset the answers to my security questions without answering two of the three security questions. The other way to reset the answers to these questions is for apple to send me an email on my rescue email addres which I DO NOT HAVE.

  • HT201269 When I try to setup my new iPad air, I go through all the steps for the iCloud sign-in and choosing security questions and what not. But after I hit the agree to the terms and conditions... It says Apple ID could not be created because of a serve

    When I try to setup my new iPad air, I go through all the steps for the iCloud sign-in and choosing security questions and what not. But after I hit the agree to the terms and conditions... It says Apple ID could not be created because of a server error. Have no clue what to do... I've restarted the iPad and get the same message. But my internet works just fine.

    1. Turn router off for 30 seconds and on again
    2. Settings>General>Reset>Reset Network Settings

  • HT5622 I keep getting a pop up about signing into an Icloud account. It won't take the password. I tried to log in on pc and sign in and screwed up on my security questions and it's kicked me out.. how long til I can try again?

    I am in iphone **** or better icloud ****. When I try to go ointo settings on the phone a signin prompt pops up continuously with one apple id. I think i've made it that i have a separate icloud and apple id. I am trying to delete the icloud id. I made all the passwords the same so that there should be no problem but the phone won't still take the password. So when i went in again, looking to see if I could delete the icloud, i screwed up answering my security questions and am now unable to enter that icloud id. How long til I can again? Secondly, since the phone won't accept any password, I have tried to delete it. When I do that, it come up with a request for that same password to shut of the locator service. What the heck? I'm frustrated. I just can't get the hang of apple software and itunes seems to be just as bad for me.  Any suggestions appreciated ( aside from stomping on it, I've considered it). Tried to take the battery out but not for me, mere mortal, thought might reset. Got sim card out. Whooopeeee.

    It sounds like you have the Find my iphone Activation lock for sure. Go to www.icloud.com/find and see if you put in that Apple ID that is coming up and yoru password to see if you are able to sign into the account that way to turn it off. If you are unable to, you will have to contact AppleCare by phone (chat cannot handle account lock outs or forgotten password due to not being able to verify your identity) and see if they can reset it. And are you sure the Apple ID that is coming up yours?

  • I can not purchase from the iTunes store because of the security question I am I do not know your security question and alternative mail has been hacked

    I can not purchase from the iTunes store because of the security question I am I do not know your security question and alternative mail has been hacked

    You need to contact Apple. Click here, phone them, and ask for the Account Security team.
    (87808)

Maybe you are looking for

  • How to get selected row no in ALV

    Hi.... I am displaying a alv in sub screen... I want to provide user functionality to delete records from alv.. The problem is i dont have a method to get row ids if user select multiple rows... I tried using GET_ROW_ID but as its a protected method

  • Error when deploying a new forms .ear file

    Hi all I get the following eror when trying to start forms: Starting OPMN managed FORMS OC4J instance ... Calling txkChkFormsDeployment.pl to check whether latest FORMSAPP.EAR is deployed... Program : /u01/apps/apps/apps_st/appl/fnd/12.0.0/patch/115/

  • I have a Ipod touch that don't turn on and when connect to itunes, it's recognize

    I need Help!!! I have a Ipod touch that don't turn on and when connect to itunes, it's recognize

  • Insert / delete fails on unique constraint (order problem)

    Hi dear Kodo team, within a transaction, we are deleting a certain jdo object. The deletion is undone later (within the same tx), resulting in creating a new object with the same contents as the deleted one (gets another oid, of course). In our datab

  • How do i REMOVE the Adobe Acrobat Plugin.

    Every time i click [Disable] then restart FF, it's back, running again. I do not want Acrobat, as i would rather use Foxit Reader. The only button in the Addons manager is [Disable] there does not seem to be a [Uninstall] or [Delete this plugin] opti