SSL connection error: javax.net.ssl.sslhandshakeexception

Open source software supply chain lighting plan, waiting for you>>>

When using socket SSL two-way connection, the client can connect to the server

However, an error occurred when transferring data: javax.net.ssl.sslhandshakeexception: null cert chain

The reason is that the keystore file used is incorrect

First, create server-side private key and public key
1, keytool – genkey – alias serverkey – keystore kserver. KS
2, keytool – export – alias serverkey – keystore kserver. KS – file server. CRT
3, keytool – Import – alias serverkey – file server. CRT – keystore tclient. KS

create client-side private key and public key
1, keytool -genkey -alias clientkey -keystore kclient.ks
2, keytool -export -alias clientkey -keystore kclient.ks -file client.crt
3, keytool -import -alias clientkey -file client.crt -keystore tserver.ks

Kserver.ks and tserver.ks should be used in server and kclient.ks and tclient.ks should be used in client

Similar Posts: