Ok..thank u very much. By the way, i'm working on your SSLUtils.java to let the application load a Keystore and init the SSLContext with user defined TrustManager and KeyManager Factory . So i can get SSLSocketFactory from the SSLContext and not from the SSLSocketFactory.getDefault() this avoids the use of System.setProperty(..) stuffs like
System.setProperty("javax.net.ssl.keyStore", pathClientKeystore) System.setProperty("javax.net.ss.trustStorePassword", passClientKeystore); System.setProperty("javax.net.ssl.keyStorePassword", passClientKeystore); that set Certificate on a JVM scope. Have u never thought about this feature? Michele P.s. Many thanks to Satish K Terala for his help -----Messaggio originale----- Da: Scott Nichol [mailto:[EMAIL PROTECTED] Inviato: Friday, October 17, 2003 4:26 PM A: [EMAIL PROTECTED] Oggetto: Re: localPort number policy I suspect that SSLSocketFactory lets the underlying TCP/IP implementation assign the local port. The behavior you describe is common. I've seen it with telnet, Web browsers and SQL Server client software. Scott Nichol Do not send e-mail directly to this e-mail address, because it is filtered to accept only mail from specific mail lists. ----- Original Message ----- From: "Trimarchi Michele" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, October 17, 2003 6:57 AM Subject: localPort number policy Hi to all. I have a question about how SSLSocketFactory uses localPort number. Which is the policy that SSLSocketFactory uses to get localport number? I put a print on SSLUtil.java after createSocket(..): sslSocket = (SSLSocket) factory.createSocket(host, port); System.out.println(sslSocket); Everytime i do a "call.invoke(...)" i see that localport number is increased. [SSL_NULL_WITH_NULL_NULL: Socket[addr=sodcsap1.dcdev.gcv/192.168.22.41,port=443,localport=1166]] [SSL_NULL_WITH_NULL_NULL: Socket[addr=sodcsap1.dcdev.gcv/192.168.22.41,port=443,localport=1167]] [SSL_NULL_WITH_NULL_NULL: Socket[addr=sodcsap1.dcdev.gcv/192.168.22.41,port=443,localport=1168]] ... [SSL_NULL_WITH_NULL_NULL: Socket[addr=sodcsap1.dcdev.gcv/192.168.22.41,port=443,localport=1253]] I saw also that socket is closed correctly and also netstat confirm it (HTTPUtils closes the socket on post() method) . Why doesn't SSLSocketFactory reuse localport number released by socket.close() and instead continues to increase localport number? Maybe is a newbie question ..sorry for that :-) .. Michele