SSL Sockets and Applets

Overview: I need to make an Applet communicate with a server using an SSLSocket and I can't figure out how to include a truststore when running the applet in a web browser.
Background:
The applet communicates perfectly using regular non-secure sockets. I am now porting it to use secure sockets (SSLSocket, SSLServerSocket from JSSE).
The applet communicates perfectly using secure sockets when run in appletviewer with the truststore file in the classpath. I have specified the appropriate truststore properties in the Applet as follows:
     System.setProperty("javax.net.ssl.trustStore", "truststore");
     System.setProperty("javax.net.ssl.trustStorePassword", "password");
This works when run using appletviewer when the "truststore" file is in the classpath, and now I need to make it work in a web browser.
Problem: How do I include the "truststore" file with an Applet?
I have tried including it in the .jar file, which seems conceptually similar to including it in the classpath, which worked with appletviewer. However, including it with the .jar file doesn't work. The exception I get is:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found
Any ideas on how I can include the truststore file or suggestions on another approach that will accomplish the same thing?
Thanks a lot!
-Jeff Dyck

Hi,
I'm in the same boat.
Thought I had a solution. I'm running an applet that opens an SSL socket back to the web server it came from
URL url = new URL("https://" + baseUrl);
URLConnection connection = url.openConnection();
connection.setDoOutput(true);
connection.setDoInput(true);
-then just open streams. Info related to this at
http://java.sun.com/products/plugin/1.3/docs/https.html
Essentially, I'm taking advantage of the SSL connection made during the initial web page/applet load ([SSL_RSA_WITH_RC4_128_MD5 is what my HTTPS server wanted )
The down side is that GET/POST are the only actions supported (refer to the link).
I'm looking for a solution that specifies HOW I ACCESS my local browser's security so I don't get
j'avax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found'.
Hope someone replies...
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • Ssl-sockets and classloading

    hi,
    i use rmi using ssl-sockets. the server rebinds to the
    rmiregistry -> it works fine but
    when i try to connect from client (browser ie) -> the needed classes (RMISSLCLientSocketFactory...)
    could not loaded
    whats the problem??
    mike

    hi,
    i use following code to test rmi with ssl-sockets:
    interface:
    import java.rmi.*;
    public interface StringTag extends java.rmi.Remote
              public String appendX(String s) throws RemoteException;
    server:
    import java.rmi.*;
    import java.rmi.server.UnicastRemoteObject;
    import java.rmi.registry.*;
    public class StringTagImpl extends UnicastRemoteObject implements StringTag
              public StringTagImpl() throws RemoteException
                        super(0, new RMISSLClientSocketFactory(), new RMISSLServerSocketFactory());
              public String appendX(String s) throws RemoteException
                        return (s + "xxx");
              public static void main(String[] arg)
                   System.setProperty("java.security.policy", "F:\\rmi\\security.policy");
                   System.setSecurityManager(new RMISecurityManager());
                   try{
                        Registry reg = LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
                        StringTagImpl so = new StringTagImpl();
                        reg.rebind("StringTag", so);
                        System.out.println("StringTag bound in registry");
                   catch(Exception e){
                        System.out.println("StringTagImpl: \n" + e);
    applet:
    import java.awt.*;
    import java.rmi.*;
    public class StringTagApplet extends java.applet.Applet
    String tagged;
    public void init()
              try
                        String host = "127.0.0.1";
                        int port = 1099;
                        StringTag st = (StringTag)Naming.lookup("//" + host + ":" + port + "/" + "StringTag");
                        tagged = st.appendX("The String: ");
              catch(Exception e)
                        System.out.println(e);
                        e.printStackTrace();
    public void paint(Graphics g)
              g.drawString(tagged,25,30);
    clientsocket:
    import java.rmi.server.*;
    import javax.net.ssl.*;
    import java.io.*;
    import java.net.*;
    public class RMISSLClientSocketFactory implements RMIClientSocketFactory, Serializable{
         public Socket createSocket(String host, int port) throws IOException{
              SSLSocketFactory factory = (SSLSocketFactory) SSLSocketFactory.getDefault();
              return factory.createSocket(host, port);          
    serversocket:
    import java.rmi.server.*;
    import javax.net.ssl.*;
    import java.io.*;
    import java.net.*;
    public class RMISSLServerSocketFactory implements RMIServerSocketFactory, Serializable{
         public ServerSocket createServerSocket(int port) throws IOException{
              SSLServerSocketFactory factory = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
              return factory.createServerSocket(port);
    the html-file:
    <HTML>
    <title>String appending</title>
    <center><h2>Append X and Y</h2></center>
    The result of appending to the Strings is:
    <p>
    <applet codebase="." code="StringTagApplet" width=500 height=120>
    </applet>
    </html>
    policy:
    grant
         permission java.security.AllPermission;
    all files are in the same folder.
    the class-file(RMISSLClientSocketFactory) could not loaded from client!
    when i make a new instance from RMISSLClientSocketFactory before line:
    StringTag st = (StringTag)Naming.lookup("//" + host + ":" + port + "/" + "StringTag");
    --> the client could not loaded class StringTag ...and so on
    i dont know why it not work!!
    i were very happy to solve this problem!!

  • Applet(using SSL sockets) application in browser

    hello everyone,
    I am new to this forum, and this is my first forum in this site, please help me,
    My problem is,
    I have done an applet application which uses the SSL sockets, and it is working fine if i use the appletviewer tool, with the arguments of policy and URL, when i run this command "appletviewer -J-Djava.security.policy=mypolicy.policy URL of my html page" in the command mode its working fine.
    I have wrote HTML file for running the applet, and when i used it in the browser i was not able to get output , i was getting the error "NoTrustedCertificates found", i have setted the properties of truststore and password in the program itself like,
    System.setProperty("javax.net.ssl.trustStore", System.getProperty("java.home")+"cert");
    System.setProperty("javax.net.ssl.trustStorePassword", "pwd");
    and i also used the policy tool. I have stored my certificate along with the jar file, and i was getting this error
    can anyone please help me, or suggest me the right way to reach my target.
    Thanx in advance

    Hai,
    I have made my client applet running from the remote system, and the client was establishing SSL sockets, and there is a problem in Handshake, NO TRUSTED CERTIFICATE found was the error, and i had loaded the certificates ( one is used for signing the certificate, and the other is used for the SSL sockets authentication ) in my applet client code i have setted the system properties like
    System.setProperty("javax.net.ssl.trustStore", System.getProperty("java.home")+"\\lib\\security\\cert");
    System.setProperty("javax.net.ssl.trustStorePassword", "pwd");
    and this is the certificate which is used for SSL sockets authentication, and i stored the cert in the "jre\lib\security\" directory, and im using the jdk1.4.2_05 version.
    At the client side the error is
    Network Error: sun.security.validator.ValidatorException: No trusted certificate found.
    at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SunJSSE_az.a(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SunJSSE_ax.a(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown Source)
    at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
    at java.io.OutputStream.write(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: sun.security.validator.ValidatorException: No trusted certificate found
    at sun.security.validator.SimpleValidator.buildTrustedChain(Unknown Source)
    at sun.security.validator.SimpleValidator.engineValidate(Unknown Source)
    at sun.security.validator.Validator.validate(Unknown Source)
    at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
    at com.sun.net.ssl.internal.ssl.JsseX509TrustManager.checkServerTrusted(Unknown Source)
    At the server side the error is
    javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
    at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.a(Unknown Source)
    at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.b(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.b(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(Unknown Source)
    at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(Unknown Source)
    at com.sun.net.ssl.internal.ssl.AppInputStream.read(Unknown Source)
    at com.ClientNeg.run(ClientNeg.java:76)
    at java.lang.Thread.run(Unknown Source)
    i was not able to understand what went wrong , so any one please help me in doing my work.
    Thanx
    dwurity

  • Some General Questions about using SSL sockets

    1 Since both SSL and TLS rely on public-key cryptography, can I use it efficiently for encrypting large amount of data transfer within a network? Or I�ll be better off using secret key.
    2 If I understand correctly, I can install client/server certificate (public key) along with the software installation. Is that right? In other words, I don�t have to create them programmatically.
    3 To convert our unsecured client/server application, is it enough to replace plain sockets with SSL sockets and use a self signed certificate for the server? (Ours is a closed network and we don�t require any client authentication).
    4 How does SSL handles server to server communications?
    5 How do you encrypt data ( some of the fields) in a text file?
    Thank you all.

    hey there.
    1.yes you can use it to encrypt large amounts of data, and heres why:
    when you use SSL, it uses public key encryption to first tranfser across a private key. then from then on the data is simply private key encrypted, which is relatively fast and easy.
    2. Yes, you may chose to make them programatically or not
    4. the question doesn't really make sense. In the end, what is a Server and what is a Client is up to your application. From SSL's point of view, you just have two machines with Sockets on either side that are connected. You can use SSLSocket.setClientMode(boolean) to choose which of those socket will act as the "server" for the purpose of the authentication handsake.

  • Sockets and lockups in applets.

    I've handed this project in a while aog now, and it had partial functionality. I was however wondering why I came accross this same recurring problem?
    I believe i have set my loops in the correct places but my applet seems to 'lock up' after one result is returned.
    If anyone can shed some light on this (I think the applet is resetting the connection each time?) I would be most grateful.
    This is the server
    import java.io.*;
    import java.net.*;
    public  class  PizzaExpressServer {
         public static void main (String []args){
              try
                   ServerSocket   SS  =  new ServerSocket(6000);
                   Socket   sts  =  SS.accept();
                   DataInputStream isfc  =  new DataInputStream(sts.getInputStream());
                   DataOutputStream ostc  =  new DataOutputStream(sts.getOutputStream());
                   while(true) {
                        int select  =  isfc.readInt();
                        System.out.println("Selection received from client " + select);
                       double total = 0.0;
                    switch(select){
                    case 1: total += 2; break;
                        case 2: total += 3; break;
                        case 3: total += 4; break;
                        case 4: total += 5; break;
                        case 5: total += 0.5; break;
                        case 6: total += 0.5; break;
                        case 7: total += 0.5; break;
                        case 8: total += 0.5; break;
                        case 9: total += 0.5; break;
                        case 10: total = 0; break;
                        ostc.writeDouble(total);
                        ostc.flush();
                        System.out.println("Price of Pizza is: "  +  total);
    } catch (IOException  e) {
                   System.out.println(e);
    And here is the client...
    //<title> Pizza Express </title>
    //<applet code="PizzaExpress.class"
    //     width=300 height=200>
    //</applet>
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.net.*;
    public class PizzaExpress extends Applet implements ItemListener {
       private CheckboxGroup One;
       private Checkbox small, medium, large, Family, Ham, Pineapple, Chicken, Sweetcorn, ExtraChesse, Reset;
       private double total;
       private int selection;
       private TextField tf;
       Panel Top = new Panel();
       Panel Bottom = new Panel();
       public void init(){
        One = new CheckboxGroup();
         add (new Label(" Select pizza size   "));
         Panel Top = new Panel();
        Panel Bottom = new Panel();
         small = new Checkbox("Small", One, false);
         add(small);     
         small.addItemListener(this);
        medium = new Checkbox("Medium", One, false);
         add(medium);
         medium.addItemListener(this);
         large = new Checkbox("Large", One, false);
         add(large);
         large.addItemListener(this);
         Family = new Checkbox("Family", One, false);
         add(Family);          
         Family.addItemListener(this);
         Ham = new Checkbox("Ham");
         add(Ham);
         Ham.addItemListener(this);
         Pineapple = new Checkbox("Pineapple");
         add(Pineapple);
         Pineapple.addItemListener(this);
         Chicken = new Checkbox("Chicken");
         add(Chicken);
         Chicken.addItemListener(this);
         Sweetcorn = new Checkbox("Sweetcorn");
         add(Sweetcorn);
         Sweetcorn.addItemListener(this);
         ExtraChesse = new Checkbox("ExtraChesse");
         add(ExtraChesse);
         ExtraChesse.addItemListener(this);
         Reset = new Checkbox("Reset");
         add(Reset);
         Reset.addItemListener(this);
         tf = new TextField(30);
         add(tf);
        Top.add(small);
         Top.add(medium);
         Top.add(large);
         Top.add(Family);
         Bottom.add(Ham);
        Bottom.add(Pineapple);
        Bottom.add(Chicken);
        Bottom.add(Sweetcorn);
         Bottom.add(ExtraChesse);
         Bottom.add(tf);
         Bottom.add(Reset);
        add(Top);
         add(Bottom);
       public void itemStateChanged(ItemEvent e) {
          try
           Socket NS = new Socket(getCodeBase().getHost(), 6000);
           DataInputStream Dis = new DataInputStream(NS.getInputStream());
           DataOutputStream Dos = new DataOutputStream(NS.getOutputStream());
           if (e.getSource() == small){
              selection = 1;}
          if (e.getSource() == medium){
              selection += 2;}
          if (e.getSource() == large){
              selection += 3;}
          if (e.getSource() == Family){
              selection += 4;}
           if (e.getSource() == Ham){
              selection += 5;}
            if (e.getSource() == Pineapple){
              selection += 6;}
            if (e.getSource() == Chicken){
              selection += 7;}
           if (e.getSource() == Sweetcorn){
              selection += 8;}
           if (e.getSource() == ExtraChesse){
              selection += 9;}
            if (e.getSource() == Reset){
              selection = 10;}
          Dos.writeInt(selection);
           Dos.flush();
           total  =  Dis.readDouble();
           tf.setText("Pizza total is ?" + total);
           } catch (IOException  ex) {
                     System.out.println(ex);}
    }I've included some HTML in at the top for easy running.

    If your code hangs somewhere, find out where. Put in some debugging println()'s to zero in on the line where it hangs.
    Looking at the code quickly, one bug seems to be that you open sockets and streams and never close them. Do that in both the server and in the client.
    You probably want to put your accept() call inside the loop, and close the accepted socket after you are done.

  • Help with SSL SOCKETS

    hi,
    i seem to have a problem with establishing an ssl socket between 2 machines. This problem has to do with certificates as the runtime error i get specifies.
    So i figured out there must be a concept that i'm misssing.
    So why do i have to place a certificate on my client? how can i generate it? where do i place it?
    Can anyone please provide me with a sample code that establishes an sslsocket connection.
    thnx a million

    A good place to start is:
    http://java.sun.com/j2se/1.4.1/docs/guide/rmi/socketfactory/SSLInfo.html
    There is a code example, but you will also need to follow the guide in the other link below to create the required key files.
    Don't base your knowledge of SSL RMI sockets solely on what I say here, as I'm fairly new to this so I may express myself wrong. But here is a 30,000 foot overview of what I did to get them to work:
    If you are using RSA on your SSL connection, a public and private key are required. For this to work, you must create a key (keystore) via Java's "keytool.exe" tool using the '-genkey' option (the keystore should eventually reside on your server). You will then create a certificate from that keystore using the '-export' option of the keytool. Lastly, you will import the certificate into your client's store of accepted certificates (the file java\lib\security\cacerts) via the '-import' option of keytool.
    For a full description, you need to read:
    http://java.sun.com/j2se/1.4/docs/guide/security/jsse/JSSERefGuide.html
    the section from this page on using keytool:
    http://java.sun.com/j2se/1.4/docs/guide/security/jsse/JSSERefGuide.html#CreateKeystore
    The example shows using a new custom file for the truststore, but I imported the certificate into Java's cacerts file instead. I was unable to find the certificate if it was not in this file, but I very well may have been doing something wrong.

  • Setting cipher suites for ssl sockets

    Hi
    While setting cipher suites for ssl serversocket and socket, there may be lot of stream ciphers and block ciphers in the list. (also there may or may not be anonymous cipher suites).
    How does the ssl socket decide which cipher suite to use?
    Sorry for this newbie question.
    Thank you.

    Have you read the JSSE Reference Guide? It has a really good description of how the SSL handshake works. Part of the "Client Hello" step includes sending all the cipher-suites the client has enabled. The server picks the "best" of that set, that the server also supports, and sends it back as part of the "Server Hello". Both sides switch to that set.
    Now, what "best" means isn't defined. I'm not sure what criteria the server uses to determine that. Maybe someone else reading the thread can chime in.
    Grant

  • Problem with SSL socket(SSLSocketFactoryImpl.createSocket())

    Hello,
    I'm trying to create a ssl socket but I get an exception, I really don't know why. I have alredy include the certificate via keytool to my jdk. And I'm able to get html header with URLConnection with the code below
    import java.net.URL;
    import java.net.URLConnection;
    public class testClass {
         public static void main(String[] args) throws Exception {
              try{
                   URL url = new URL("https://ippbx1:8443/axl/");
                   String userPassword = "****" + ":" + "****";
                   String encoding = new sun.misc.BASE64Encoder().encode (userPassword.getBytes());
                   URLConnection c = url.openConnection();
                   c.setRequestProperty("Authorization", "Basic " + encoding);
                   for (int i=0; ; i++)
                        String name = c.getHeaderFieldKey(i);
                        String value = c.getHeaderField(i);
                        if (name == null && value == null)     // end of headers
                             break;        
                        if (name == null)     // first line of headers
                             System.out.println("Server HTTP version, Response code:");
                             System.out.println(value);
                             System.out.print("\n");
                        else
                             System.out.println(name + "=" + value);
              catch (Exception e) {}
    }and I get the following result :
    Server HTTP version, Response code:
    HTTP/1.1 200 OK
    Server=Apache-Coyote/1.1
    Pragma=No-cache
    Cache-Control=no-cache
    Expires=Thu, 01 Jan 1970 01:00:00 CET
    Set-Cookie=JSESSIONIDSSO=77670D5480DAD295C6519E812F9FED64; Path=/
    Set-Cookie=JSESSIONID=B71BDB730FA5B3B431D3B16C41E190E3; Path=/axl; Secure
    Content-Type=text/html;charset=ISO-8859-1
    Content-Length=233
    Date=Wed, 10 Jun 2009 15:17:10 GMTBut when I try to make a socket :
    import java.io.*;
    import java.net.*;
    import javax.net.SocketFactory;
    import javax.net.ssl.SSLSocketFactory;
    public class axlforward {
         public static void main(String[] args) {
    String address = "https://ippbx1:8443/axl/";        
              int portnum = 8443;
    try
                   SocketFactory socketFactory = SSLSocketFactory.getDefault();
                   Socket socket = socketFactory.createSocket(address, portnum);
    } catch (Exception e) {e.printStackTrace();} I get the following
    java.net.UnknownHostException: https://ippbx1/axl/
         at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
         at java.net.Socket.connect(Socket.java:519)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:550)
         at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:353)
         at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:71)
         at axlforward.main(axlforward.java:89)I have a VB program that connects to the socket(with Inet1.Protocol = icHTTPS and Inet1.Execute strURL, "Post", strFormData, strFormHdr methods) and do what I want but I need to do it in Java but I'm not able to find the error.
    the server socket is a Cisco callManager Service(AXL Web Service) which receives and html+SOAP request and sends back an xml response and this server socket is running correctly with no problem.
    Thanks for your help.

    Jdevelopper8709 wrote:
    Thanks for your reply.
    I now can access to my socket and get the information I want with:
    SocketFactory socketFactory = SSLSocketFactory.getDefault();
                   socket = (SSLSocket) socketFactory.createSocket("ippbx1", 8443);In fact the problem was a username/password issue.
    Thanks.I quote from reply #1 "The address is just "ippbx1" and not "https://ippbx1:8443/axl/". The protocol is not part of the IP address.".

  • I receive an error in Firefox 4.0 Beta 11: Secure Connection Failed An error occurred during a connection. Renegotiation is not allowed on this SSL socket. (Error code: ssl_error_renegotiation_not_allowed) Anyone know how to fix this?

    I have installed the Firefox 4.0 Beta 11 (+updates), I try to connect to our https: website and I receive the following error:
    Secure Connection Failed An error occurred during a connection.
    Renegotiation is not allowed on this SSL socket.
    (Error code: ssl_error_renegotiation_not_allowed)
    I have installed this certificate on Firefox 3.6.13 and I am able to connect to our HTTPS site but it will not work with the Beta 4.0 11

    I read about this for ages. I had problems setting up a certificate for my online banking. This one solution genuinely worked for me (finally!) ...Fingers crossed it will for you too:
    1) In the address bar type in '''about:config''' ...Firefox will say it's dangerous, but I just went ahead anyway lol - It's fine. Thank god there's always an edit-undo!
    2) Copy and paste this into the ''filter'' at the top: '''security.ssl.allow_unrestricted_renego_everywhere'''
    3) Then change ''false'' to ''true'' (I think I just clicked it, and it changed)
    That's it! Refresh your bank page, and it should work!
    (Spanish source: '''http://translate.google.com/translate?sl=es&tl=en&js=n&prev=_t&hl=en&ie=UTF-8&layout=2&eotf=1&u=http%3A%2F%2Fwww.fedora-ve.org%2F2011%2F09%2F14%2Ferror-error-code-ssl_error_renegotiation_not_allowed-en-firefox-4-x.html&act=url''')

  • Issue porting WebLogic 8.1 SSL Socket code to WebLogic 9.2

    I did not write this code, but am trying to port the code from Weblogic 8.1 to Weblogic 9.2. The code comes from a custom OpenLDAPAuthenticator, that uses a SSL Socket to connect to an LDAP server.
    The following lines are used:
    Socket socket = SSLSocketFactory.getDefaultJSSE().createSocket(host, port);
    if (socket instanceof SSLSocket) {
      SSLContextWrapper sslcontextwrapper = SSLContextManager.getInstance().getDefaultSSLContext();
      sslcontextwrapper.forceHandshakeOnAcceptedSocket((SSLSocket) socket);
    }Does anyone know what this forceHandshakeOnAcceptedSocket method does, and if there is way to write this in WebLogic 9.2?
    Thanks

    I did not write this code, but am trying to port the code from Weblogic 8.1 to Weblogic 9.2. The code comes from a custom OpenLDAPAuthenticator, that uses a SSL Socket to connect to an LDAP server.
    The following lines are used:
    Socket socket = SSLSocketFactory.getDefaultJSSE().createSocket(host, port);
    if (socket instanceof SSLSocket) {
      SSLContextWrapper sslcontextwrapper = SSLContextManager.getInstance().getDefaultSSLContext();
      sslcontextwrapper.forceHandshakeOnAcceptedSocket((SSLSocket) socket);
    }Does anyone know what this forceHandshakeOnAcceptedSocket method does, and if there is way to write this in WebLogic 9.2?
    Thanks

  • Can I use AWT and Applets in a J2EE project???

    Hi,
    I adore applets and the package AWT... And I would like to know if some way exists to integrate my applet with my application J2EE... I want to use these in the vision tier in a J2EE(EJB) project...
    How can I make that my applet acts as an observing process of my model??? If the JVM will be informed on any alterations in the model will be the JVM of the server while my applet will be being executed for the JVM of browser...
    []'s
    Ary Junior

    I have a J2EE application, for which I have a module which is used by system administrators. this module is completly written in Java swing.
    and it does talk to my EJBs.
    If you don't have a firewall in your application, then you can directly make your applications in awt, swing and applets talk to EJBs. if you do have a firewall, then just write a web-service wrapper over your EJBs and other J2EE components and use them from desktop applications.
    It seems that you want to implement a kind of a applet based monitor application for your J2EE EJBs on the server. Applets cannot directly monitor your EJBs.
    Create a new module which has a service which acts as an event listener on the server. each j2ee component on the server notify it if there is a change to them. this service, can then write the data realted to the modification on a socket which is continiously being read by the applet. So you can implement a kind of a monitor for J2ee apps with applets.
    hope this helps.
    regards,
    Abhishek.
    PS:How did you manage to adore the AWT ;-) ? I found that it sucks (good performance.. very poor lnf) ... java swing sucks too (very poor performance ... avaerage lnf).

  • Creating a TSL/SSL socket connection to a server

    Hi
    Is it posible to create a TSL/SSL socket connection to a server with as3 - webapp, I foundSecureSocket but it seems like it is only for Air, and is not in the flex 4.5 sdk?
    Then NetConnection has it, but can you use it with a server that we have created our self? I think I read that if we use flashremoting, we can?
    We are using As3Crypto but there is a lot of overhead on using this, as it is not native code.

    bump

  • Browsers and applet

    Hi,
    I wrote a small applet that open a udp socket and listen to it, when some packet it's received a button it's enabled. I use netscape 6.2.3 and java VM 1.3.1_02 on Linux 2.4.18, but the buttom have a strange behaviour, in some pc's with the same configuration the button it's enabled but no action seem be taken except for a ugly beep. The java console of the browser show me no error, it seem locked, and his bottons have the same behaviour of my applet botton. I've also try with the new version of netscape 7.1 and java VM but the problem still remain.
    Can someone help me?
    Thanks a lot
    p.s.
    if someone 'd test my code I can send it

    Hi Will,
    I'll send you my code to your e-mail address on yahoo.
    Thanks
    M

  • Need help on Socket and HTTP

    Hi,
    I need help ... please ... I have to use socket and not HTTPURLConnection
    I try to connect with a socket to a web server (apache2) and request one page but two times.
    The first time it works well but the second one it doesn't ... I get a null message.
    Why ?
    Does the server close the socket as soon as the page is sent ?
    If it doesn't how I can continue sending and receiving data on the same socket ?
    Here is my code:
    package test;
    import java.net.*;
    import java.io.*;
    public class Test
    private String laRequete = new String(
    "POST http://localhost:5577/Test/ HTTP/1.0\r\n"+
    "Host:localhost:5577\r\n"+
    "\r\n");
    PrintWriter laSortie;
    BufferedReader lEntree;
    Socket laSocketTCP;
    public Test()
    String tmp;
    try
    laSocketTCP = new Socket("localhost", 5577);
    laSortie = new PrintWriter(laSocketTCP.getOutputStream());
    lEntree = new BufferedReader(new InputStreamReader(laSocketTCP.getInputStream()));
    laSortie.println(laRequete);
    laSortie.flush();
    // Premier essai OK
    System.out.println(lEntree.readLine());
    while((tmp = lEntree.readLine()) != null)
    System.out.println(tmp);
    // Second essai => Not OK
    laSortie.println(laRequete);
    laSortie.flush();
    System.out.println(lEntree.readLine());
    while((tmp = lEntree.readLine()) != null)
    System.out.println(tmp);
    catch (Exception e)
    e.printStackTrace();
    public static void main(String args[])
    Test tp = new Test();
    Here is the result of the execution
    HTTP/1.1 200 OK
    Date: Wed, 29 Sep 2004 08:35:35 GMT
    Server: Apache/2.0.51 (Win32)
    Last-Modified: Wed, 29 Sep 2004 08:27:57 GMT
    ETag: "23a46-9a-56c93f9a"
    Accept-Ranges: bytes
    Content-Length: 154
    Connection: close
    Content-Type: text/html; charset=ISO-8859-1
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> Index Test 1 </TITLE>
    </HEAD>
    <BODY>
    Test 1
    </BODY>
    </HTML>
    null
    Thanks, bye.

    Send an HTTP 1.1 request instead of a 1.0 request.
    HTTP 1.0 does not support keeping the connection open, so yes, the server closes the connection.
    Dave.

  • Cannot access to any site with ssl connection and fail to open safari and keychain, unless restart computer and login in with Guest account.

    when Update to 10.7.2 ,I cannot access to any site with ssl connection and fail to open safari and keychain, unless restart computer and login in with Guest account.
    OS:10.7.2
    Macbook Pro 2010-mid 13inch

    I also have the same problem, however if I use Firefox or Opera sites with ssl connection work fine. Still, I can't use Google Chrome (ssl), Safari (ssl), the Mac app store (generally), or the iTunes store (generally). Both the iTunes store, Safari and the app store won't respond, and Chrome displays this error: (net::ERR_TIMED_OUT). The problem persists regardless of what network I'm using. Also, when trying to access the keychain or iCloud, the process will not start (will hang). I didn't have these problems at all before updating to 10.7.2.
    Sometimes rebooting helps, and sometimes not. If the problem disappears by rebooting, then it only lasts a few minutes before it reappears. It is very frustrating, especially since there doesn't seem to be any obvious or consistent way of which to fix it.
    I'm also using a Macbook Pro 13-inch mid 2010.

Maybe you are looking for

  • Manually Migrating from Oracle 10g to 11g

    Hello, I'm currently a student in an Oracle DBA class. I'm totally new to the Oracle world. One of our final assignments concerns upgrading Oracle instances without the use of DBUA. I've currently got Oracle Database 10g Enterprise Edition Release 10

  • Apple TV and Netflix

    I just bought an Apple TV because I was told I could watch Netflix. On hooking it up I found that only rentals were available and none of the free content. I enjoy watching old foreign language films that are free on Netflix. How can we make this hap

  • How to acess windows share from Ipad ios 7

    how to acess windows share from Ipad ios 7

  • I have migrated Scrippt as smartform but in pdf O/P chinese chars corrupted

    Hi Experts, we have migrated sap script as smartform and modified the driver program accordingly. In print preview  output is fine and no data corruption. we are converting this output as PDF and sending via email. For this we have used FM 'CONVERT_O

  • 5.1 Mixing in Audition CS5.5

    Is it just me or is surround mixing superior in Premiere than it is in Audition? In premiere, I have the ability to do multichannel panning AND and I can save the whole thing as Dolby Digital 5.1. I can't seem to find either of these functions in Aud