Import server certificate (not https)

Hello i've been long looking for the way to implement same mechanism that

works in https connections but in a swing app. This is Ialready have client and

server both authenticated to each other to set up an SSL communication....

but this works as long as i use externallykeytool[/] to exchange the keys,

andI want Client may choose to import or not the server certificate

on the first connection, . as it happens in the case of https connections.

I use Custom Socket Factories as it must be; loading the key stuff on both sides as keystore and as truststore an all the rest.

Thanx.

PD:Sorry i messed with my first trial and i posted at a generic branch.

[742 byte] By [alvakoldo10a] at [2007-10-2 21:17:24]
# 1
Add a handshake listener to the socket and ask the user if they trust the peer certificate supplied with the HandshakeCompletedEvent. If not, just close the SSLSocket.
ejpa at 2007-7-14 0:25:54 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...
# 2

?a handshake listener ? the only one known is

HandShakeCompletedListener and that's too late for my case as this

listener fires just when handshake finishes, but if no trust exists yet (as this is

the trouble i'm in) then there'll be no completion of handshake at all....am i

wrong?

alvakoldo10a at 2007-7-14 0:25:54 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...
# 3
Correct, my mistake, I misunderstood your requirement.In that case you will have implement your own TrustManager. See the Guide to Features/Security/JSSE for details.
ejpa at 2007-7-14 0:25:54 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...