2016-11-07 92 views
0

期間是指認證文件,我有一個Maven化項目(Web應用程序),我用SpringBoot打包並運行它。我將它打包成戰爭,然後使用spring-boot:run maven目標啓動它。 該應用程序會調用幾個需要證書的第三方供應商RESTful API。 我有供應商的cacert文件;對於我的本地主機,我已經把我的文件系統,它指使用javax.net.ssl.trustStore命令行參數的證書文件SpringBoot推出[所以,像這樣:javax.net.ssl.trustStore=<path to cacert file on my file system>]在 現在我已經決定繼續CACERT文件在我的類路徑(所以在src/main/resources下的一些文件夾)。 我希望SpringBoot在啓動時加載這個資源,並使用javax.net.ssl.trustStore系統屬性來引用它。 有人可以協助我該怎麼辦?如何SpringBoot啓動

回答

0

這裏是SSL屬性的列表(這些添加到application.properties文件):

server.ssl.ciphers= # Supported SSL ciphers. 
server.ssl.client-auth= # Whether client authentication is wanted ("want") or needed ("need"). Requires a trust store. 
server.ssl.enabled= # Enable SSL support. 
server.ssl.enabled-protocols= # Enabled SSL protocols. 
server.ssl.key-alias= # Alias that identifies the key in the key store. 
server.ssl.key-password= # Password used to access the key in the key store. 
server.ssl.key-store= # Path to the key store that holds the SSL certificate (typically a jks file). 
server.ssl.key-store-password= # Password used to access the key store. 
server.ssl.key-store-provider= # Provider for the key store. 
server.ssl.key-store-type= # Type of the key store. 
server.ssl.protocol=TLS # SSL protocol to use. 
server.ssl.trust-store= # Trust store that holds SSL certificates. 
server.ssl.trust-store-password= # Password used to access the trust store. 
server.ssl.trust-store-provider= # Provider for the trust store. 
server.ssl.trust-store-type= # Type of the trust store. 

希望它能幫助,參考:http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html