I have a problem with Secure Grizzly HttpServer, my method load the keystore file and truststore file and she works for the certs self-signed.
private static SSLContextConfigurator getSSLContextConfigurator() {
final SSLContextConfigurator sslContextConfigurator = new SSLContextConfigurator();
sslContextConfigurator.setKeyStoreFile("keystore_server");
sslContextConfigurator.setKeyStorePass("password");
sslContextConfigurator.setTrustStoreFile("truststore_server");
sslContextConfigurator.setTrustStorePass("password");
return sslContextConfigurator;
}
But when I want to import my certs signed by a CA into keystore or truststore, like:
keytool -genkey -keyalg RSA -keystore ./keystore_client -alias clientKey
keytool -export -alias clientKey -rfc -keystore ./keystore_client > ./client.cert
keytool -import -alias clientCert -file ./client.cert -keystore ./truststore_server
keytool -import certsigned.pem -keystore ./keystore_server -alias serverKey
keytool -export -alias serverKey -rfc -keystore ./keystore_server > ./server.cert
keytool -import -alias serverCert -file ./server.cert -keystore ./truststore_client
My application startup without error, but when I use curl/browser I have a client error:
curl: (35) Unknown SSL protocol error in connection to domain.com:8090
Browser: ERR_CONNECTION_CLOSED
How to properly import my certs signed with keytool?
EDIT
My certificates already work in a website, so he isn't invalid.