M
Marco Parmeggiani
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
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