Skip to content
Advertisement

SSL Java java.io.IOException: Invalid keystore format

I am testing SSL in java with SSLServerSocket and other classes in the java.ssl package. When I run the following code, I get the exception java.io.IOException: Invalid keystore format. My code:

JavaScript

File key.txt: 1268312345812304612348712634283427346 I am guessing I should put something else in the key.txt file, but I do not know what to put in it. Probably a searilized object.

EDIT: Client Code:

JavaScript

Advertisement

Answer

Your file is invalid. You have to import a JKS keystore file and not a txt one. You have to use the keytool to create your keystore file and then import this file.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement