gpt4 book ai didi

ssl - 获取 i5 Keymanager 和 Trustmanager 时出错

转载 作者:太空宇宙 更新时间:2023-11-03 14:17:10 24 4
gpt4 key购买 nike

我正在尝试使用发送到 Paypal 。

我收到一条错误消息,指出我的信任管理器尚未初始化。 (我认为)。

这是我进入 SSL 的第一步,所以我可能没有正确设置它。我收到 SSlConfigurationException。

public static SSLContext setupClientSSL(String certPath, String certPassword)
throws SSLConfigurationException {
SSLContext sslContext = null;
try {
KeyManagerFactory kmf =
KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());

KeyStore ks = p12ToKeyStore(certPath, certPassword);
kmf.init(ks, certPassword.toCharArray());
//sslContext = getSSLContext(kmf.getKeyManagers());
sslContext = SSLContext.getInstance("SSL", "IBMJSSE2");
} catch (NoSuchAlgorithmException e) {
throw new SSLConfigurationException(e.getMessage(), e);
} catch (KeyStoreException e) {
throw new SSLConfigurationException(e.getMessage(), e);
} catch (UnrecoverableKeyException e) {
throw new SSLConfigurationException(e.getMessage(), e);
} catch (CertificateException e) {
throw new SSLConfigurationException(e.getMessage(), e);
} catch (NoSuchProviderException e) {
throw new SSLConfigurationException(e.getMessage(), e);
} catch (IOException e) {
throw new SSLConfigurationException(e.getMessage(), e);
}
return sslContext;
}

最佳答案

信息中心有使用 Java Secure Socket Extension 的文档包括设置和示例代码。

关于ssl - 获取 i5 Keymanager 和 Trustmanager 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17168068/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com