用戶端提供者必須與同其互動的伺服器端提供者具有相同的訊息保護策略。在安裝 GlassFish Server 時已配置 (但未啟用) 的提供者符合此情況。
若要啟用應用程式用戶端的訊息安全性,請修改應用程式用戶端容器的特定 GlassFish Server 配置。
為讓您瞭解整個脈絡,特在此顯示周圍程式碼;實際安裝的情況可能稍有不同。 請勿加以變更。
<client-container> <target-server name="your-host" address="your-host" port="your-port"/> <log-service file="" level="WARNING"/> <message-security-config auth-layer="SOAP" default-client-provider="ClientProvider"> <provider-config class-name="com.sun.enterprise.security.jauth.ClientAuthModule" provider-id="ClientProvider" provider-type="client"> <request-policy auth-source="sender"/> <response-policy/> <property name="security.config" value="C:/Sun/AppServer/lib/appclient/wss-client-config.xml"/> </provider-config> </message-security-config> </client-container>
在用戶端容器中配置的訊息安全性提供者必須有權存取私密金鑰和可信任的憑證。若要為它提供存取權限,請在應用程式用戶端啟動程序檔中設定以下系統特性的值:
-Djavax.net.ssl.keyStore
-Djavax.net.ssl.trustStore