2016-11-07 33 views
0

私はMavenizedプロジェクト(Webアプリケーション)を使用しており、SpringBootを使用してパッケージ化して実行しています。私はそれを戦争としてパッケージ化し、spring-boot:runの目標を使用して起動します。 アプリケーションは、証明書を必要とする第三者ベンダーのRESTful APIをいくつか呼び出します。 ベンダーのファイルcacertがあります。私のローカルホストでは、私のファイルシステムにcertファイルを保存しておいて、SpringBootの起動時にjavax.net.ssl.trustStoreコマンドライン引数を使って参照しています[javax.net.ssl.trustStore=<path to cacert file on my file system>] これでcacertファイルをクラスパスに保存することにしましたsrc/main/resourcesの下にいくつかのフォルダがあります)。 私はSpringBootに起動時にこのリソースをロードし、システムプロパティを使用して参照します。 私はそれをどうやって行うことができますか?ここで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

関連する問題