ssl createSocket slow on tomcat

Discussion in 'Java' started by Marco Parmeggiani, Aug 1, 2003.

  1. I create a client side ssl socket this way:

    X509TrustManager xtm = new AWTrustManager();
    TrustManager mytm[]={xtm};
    SSLContext ctx = null;
    ctx = SSLContext.getInstance("SSL");
    ctx.init(null, mytm, null);
    SocketFactory factory = ctx.getSocketFactory();
    Socket s = factory.createSocket(shost, sporta);

    if i use this code in a standalone application, createSocket returns in
    about 1 second or less. If i execute it in a class used from a jsp under
    tomcat, the operation takes 3/4 seconds...

    i've monitored the connection on the server side (also written in java)
    and i've seen that the ssl handshake is pretty fast. After the handshake
    the server sends a string to the client then sits waiting for requests
    from it. Meanwhile the client, even after the server has already sent
    it's "welcome message", continues to stay locked on createSocket for 3/4
    seconds then returns and the communication continues correctly...

    i really don't know why i have this problem under tomcat.

    i've also tested the connection without using ssl and ther is no
    problem.

    j2sdk 1.4.1_02
    tomcat 4.0.6

    thanks
    ciao
    --
    Seti@Home Java Applets
    http://maruko.webhop.net/
     
    Marco Parmeggiani, Aug 1, 2003
    #1
    1. Advertising

  2. Marco Parmeggiani

    Roedy Green Guest

    On Fri, 01 Aug 2003 17:25:57 +0200, Marco Parmeggiani
    <> wrote or quoted :

    >if i use this code in a standalone application, createSocket returns in
    >about 1 second or less. If i execute it in a class used from a jsp under
    >tomcat, the operation takes 3/4 seconds...


    I am puzzled. If I read you literally you are distressed that Tomcat
    is 0.25 seconds faster than it "should" be.

    Is there a typo somewhere in your message?

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Aug 1, 2003
    #2
    1. Advertising

  3. On Fri, 01 Aug 2003 20:28:42 GMT, Roedy Green <>
    wrote:

    >On Fri, 01 Aug 2003 17:25:57 +0200, Marco Parmeggiani
    ><> wrote or quoted :
    >
    >>if i use this code in a standalone application, createSocket returns in
    >>about 1 second or less. If i execute it in a class used from a jsp under
    >>tomcat, the operation takes 3/4 seconds...

    >
    >I am puzzled. If I read you literally you are distressed that Tomcat
    >is 0.25 seconds faster than it "should" be.
    >
    >Is there a typo somewhere in your message?


    LOL... 3/4... i mean 3 or 4 seconds, not 0.75. So, Tomcat is 3 or 4
    times slower than it "should" be. Sorry, in my neighbourhood it's common
    to write those numbers that way.

    ciao
    --
    Seti@Home Java Applets
    http://maruko.webhop.net/
     
    Marco Parmeggiani, Aug 4, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    3,054
  2. HK
    Replies:
    3
    Views:
    463
  3. mike
    Replies:
    3
    Views:
    404
    Virgil Green
    Jul 11, 2005
  4. JosephByrns

    Slow, then quick then slow

    JosephByrns, Jul 10, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    2,507
    codezilla94
    Nov 13, 2007
  5. con

    SLOW oh so slow

    con, May 26, 2008, in forum: ASP .Net
    Replies:
    4
    Views:
    436
Loading...

Share This Page