【发布时间】:2021-06-28 11:53:23
【问题描述】:
我部署了一个 spring 微服务 docker。 我使用 JaxWsProxyFactoryBean 调用外部服务器(soap/wsdl),使用 http://externalServer 一切顺利:
JaxWsProxyFactoryBean jaxWsProxyFactoryBean = new JaxWsProxyFactoryBean();
jaxWsProxyFactoryBean.setAddress("http://externalServer");
...
当我在 setAddress 中调用 https 时出现问题。
我使用 keytool 在密钥库中注册了被调用服务器的密钥/证书,并将其保存到 /root/.keystore(标准)从 pfx 导入。 当我尝试调用 https 时,我收到此错误:
org.apache.cxf.transport.https.SSLUtils : Default key managers cannot be initialized: Password must not be null
好的,我缺少密码。但是这个恶意密码放在哪里?在 application.yml?在系统属性中? [keystore中使用的密码是标准的(changeit)]
已编辑
这里是日志的快照:
DEBUG 1 --- [ XNIO-1 task-1] org.apache.cxf.transport.https.SSLUtils : The location of the key store has not been set via a system parameter or through configuration so the default value of /root/.keystore will be used.
DEBUG 1 --- [ XNIO-1 task-1] org.apache.cxf.transport.https.SSLUtils : The key store password has not been set via a system property or through configuration, reading data from the keystore will fail.
DEBUG 1 --- [ XNIO-1 task-1] org.apache.cxf.transport.https.SSLUtils : The key password has not been set via a system property or through configuration, reading data from the keystore will fail.
DEBUG 1 --- [ XNIO-1 task-1] org.apache.cxf.transport.https.SSLUtils : The keystore type has not been set in configuration so the default value of JKS will be used.
WARN 1 --- [ XNIO-1 task-1] org.apache.cxf.transport.https.SSLUtils : Default key managers cannot be initialized: Password must not be null
使用标准密钥库,但没有密码。
【问题讨论】:
-
您是如何为您的 Apache CXF 客户端配置 SSL 配置的?你能分享一个例子吗?
-
我使用springboot全部运行,没有特别配置。我在哪里可以找到这个配置?
标签: spring docker ssl cxf keytool