java - certificate_unknown exception in ssl -


i have server , client, both communicate between each other using ssl. previous self signed sslkeystore expired @ server, generated new 1 same details extended validity . when try communicate server client, following exception.

javax.net.ssl.sslhandshakeexception: received fatal alert: certificate_unknown @ sun.security.ssl.alerts.getsslexception(alerts.java:192) @ sun.security.ssl.alerts.getsslexception(alerts.java:154) @ sun.security.ssl.sslsocketimpl.recvalert(sslsocketimpl.java:1991) 

it working till updated keystore.

its creating exception following block of code. when try read bufferedinputstream bis.

    private byte[] readbytesfromstream(bufferedinputstream bis) throws ioexception {      byte[] lengthbytes = new byte[4];     bis.read(lengthbytes);     int length = bytebuffer.wrap(lengthbytes).getint();     system.out.print("length : " + length);      byte[] data = new byte[length];     bis.read(data);      return data; } 

should else reflect updated keystore.

i had make public key of server trusted keystore in client. onwards started working. found excellent tool online deal kind of things keystores , certificates called portecle (https://sourceforge.net/projects/portecle/)


Comments