use curl:
curl -v https://xxxxxx --cert ./dss.chain.pem --key ./privatekey.pem --pass admin
i can get 400 errors.This is the correct return.
now,I need to use the Java implementation.
I've tried doing this several different ways.
.pem--> .jks = fail httpclient = fail.
some code:
private static KeyStore getKeyStore(String keyStorePath, String password, String type)
throws KeyStoreException, CertificateException, IOException, NoSuchAlgorithmException {
// 获取证书
FileInputStream inputStream = new FileInputStream(keyStorePath);
// 秘钥仓库
KeyStore keyStore = KeyStore.getInstance(type);
keyStore.load(inputStream, password.toCharArray());
inputStream.close();
return keyStore;
}
keyStore.load(inputStream, password.toCharArray()) throw exception
Exception in thread "main" java.io.IOException: toDerInputStream rejects tag type 45
at sun.security.util.DerValue.toDerInputStream(DerValue.java:847)
at sun.security.pkcs12.PKCS12KeyStore.engineLoad(PKCS12KeyStore.java:1915)
at java.security.KeyStore.load(KeyStore.java:1445)