Configuring SSL at the Client Side
The client must send a request to the HTTPS endpoint using the port specified at the server side. You can configure SSL at the client side using either of the methods below.
Set the properties in your security configuration file. You can configure this file as a parameter in the axis2.xml configuration file:
<parametername="securityConfigFile">your_client_security_config_file
path</parameter>
If you do not define a security configuration file, the client uses information in the wsclientsec.properties file in the current working directory.
Use the
Web Services Stack client API to set the required properties, as follows:
//create the WS Stack client:IWSStaxClient client = ......
IWSOptions options = client.getWSOptions();
options.setProperty(WSClientConstants.KEYSTORE_PASSWO RD_SIGN, "changeit");
options.setProperty(WSClientConstants.KEYSTORE_FILE_SIGN, "C:\\client.jks");
//execute the clientclient.sendReceive(...);
The table below shows the security properties at the client side that relate to the SSL configuration.
Property | Description |
KEYSTORE_SSL_ LOCATION | Keystore file to use for SSL authentication. This property corresponds to the JSSE javax.net.ssl.keyStore system property. You need only specify the keystore file if the remote SSL server requires client authentication. |
SSL_KEYSTORE_ PASSWORD | Password to use to access the keystore file. This property corresponds to the JSSE javax.net.ssl.keyStorePassword system property. |
SSL_KEYSTORE_TYPE | Type of the keystore file. |
TRUSTSTORE_SSL_ LOCATION | Truststore file to use for SSL authentication. The client requires that the server's certificate is installed in this truststore and it is trusted. This property corresponds to the JSSE javax.net.ssl.trustStore system property. If the property is not set, the client uses Java-homelib/security/jssecacerts and Java-home/lib/security/cacerts, in that order. |
TRUSTSTORE_SSL_ PASSWORD | Password for the truststore file. This property corresponds to the javax.net.ssl.trustStorePassword system property. |
For more information, see the JSSE Reference Guide.