【发布时间】:2018-06-25 16:29:23
【问题描述】:
Camel Spring Boot 应用程序版本 2.20.1
如何在启动时将 application.properties 值加载到 spring config xml 参数?
例如:几个参数定义如下:-
eas.ssl.key-store-type = JKS
eas.ssl.key-store-password = *****
eas.ssl.key-store = filelocation
现在启动时同样需要在 Spring Config XML 中配置如下:
<sec:keyStore type="${eas.ssl.key-store-type}" password="${eas.ssl.key-store-password}" file="${eas.ssl.key-store}" />
在日志中,我可以看到应用程序属性中的属性按预期检测到
PropertySourcesPropertyResolver : Found key 'eas.ssl.key-store-password'
但是,看起来键上的键并未作为值应用于配置 xml。 错误日志指出:-
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.
【问题讨论】:
-
<sec:命名空间是什么,它来自哪里。 -
命名空间符号来自这个 xmlns 标记:xmlns:sec="cxf.apache.org/configuration/security" 我猜这与某些版本的骆驼 cxf 罐子。但不确定,仍在研究中。 -
我猜,这个问题与属性文件加载无关。但是与正在应用的 jdk 版本+cxf+camel jars 版本有关。正在将现有的基于 jdk1.6 的骆驼应用程序使用 SSL 握手调用 SOAP 服务转换为新的基于 Spring Boot 的应用程序;看起来 cxf,用于 1.6 版本的骆驼罐不适合这里。我得到的错误是 -"javax.net.ssl.SSLHandshakeException: No proper protocol" 。在 1.6 中使用相同的 jks 凭据,这个相同的肥皂调用工作正常。我的直觉是这个 jar 的版本是罪魁祸首 [cxf-rt-transports-http-3.0.5.jar:3.0.5]
标签: spring-boot configuration ssl-certificate sslhandshakeexception