我的应用程序在 BlueMix 中运行,它必须通过 SSL 对另一个应用程序进行静态调用。我想知道在哪里以及如何添加这些信息
> trustStoreType, trustStore and trustStorePassword
那么在 bluemix 中运行的应用程序可以使用它吗?当我从本地进行测试时,我修改了服务器类路径,我可以在运行客户端应用程序的 bluemix liberty 服务器中做一些类似的事情吗?还是有更简单更好的方法?
最佳答案
你应该能够在 eclipse 中编辑 server.xml 并设置类似的东西
<server description="new server"> <!-- Enable features --> <featureManager> <feature>websocket-1.0</feature> <feature>localConnector-1.0</feature> <feature>jndi-1.0</feature> <feature>jsp-2.2</feature> <feature>jdbc-4.0</feature> <feature>ejbLite-3.1</feature> <feature>ssl-1.0</feature> <feature>jaxb-2.2</feature> </featureManager> <ssl clientAuthenticationSupported="true" id="defaultSSLConfig" keyStoreRef="defaultKeyStore" trustStoreRef="defaultTrustStore"/> <keyStore id="defaultKeyStore"location="${server.config.dir}/resources/security/keystore.jks" password="passw0rd" type="JKS"/> <keyStore id="defaultTrustStore" location="${server.config.dir}/resources/security/trustStore.jks" password="passw0rd" type="JKS"/> <ssl clientAuthenticationSupported="true" id="defaultSSLConfig" keyStoreRef="serverKeyStore" trustStoreRef="serverTrustStore"/> <keyStore id="serverKeyStore" location="${server.config.dir}/resources/security/serverKey.jks" password="passw0rd" type="JKS"/> <keyStore id="serverTrustStore" location="${server.config.dir}/resources/security/serverTrust.jks"> password="passw0rd" type="JKS"/> <!-- customize SSL configuration --> <ssl id="customizeSSLConfig" keyStoreRef="clientKeyStore" trustStoreRef="clientTrustStore"/> <keyStore id="clientKeyStore" location="${server.config.dir}/resources/security/clientKey.jks" password="passw0rd" type="JKS"/> <keyStore id="clientTrustStore" location="${server.config.dir}/resources/security/clientTrust.jks" password="passw0rd" type="JKS"/> <!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" --> <httpEndpoint httpPort="8080" httpsPort="9443" id="defaultHttpEndpoint"/> <applicationMonitor updateTrigger="mbean"/> </server>
最简单的方法是使用用于 eclipse 的 Bluemix 插件和使用 Websphere Libery Profile Server
关于ssl - 当客户端在 bluemix 中时,通过 HTTPS 调用安全的 RESTful Web 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32173375/