...
Change the port and the hostname ('
is.dev.wso2.com
' is taken as an example) in<IS_HOME>/repository/conf/carbon.xml
. (Make sure the management hostname is also the same)Code Block language xml <HostName>is.dev.wso2.com</HostName> <MgtHostName>is.dev.wso2.com</MgtHostName>
All keystores in WSO2 IS are stored in the
<IS_HOME>/repository/resources/security
folder. Navigate to the security folder on the command prompt and use the following command to create a new keystore withCN=is.dev.wso2.com
.Code Block title Format keytool -genkey -alias <alias_name> -keyalg RSA -keysize 2048 -keystore <keystore_name>.jks -dname "CN=<hostname>, OU=<organizational_unit>,O=<organization>,L=<Locality>,S=<State/province>,C=<country_code>" -storepass <keystore_password> -keypass <confirm_keystore_password>
Replace the values enclosed in
<>
in the command given above with a value you prefer as shown in the sample command below.Code Block title Sample keytool command keytool -genkey -alias newcert -keyalg RSA -keysize 2048 -keystore newkeystore.jks -dname "CN=is.dev.wso2.com, OU=Is,O=Wso2,L=SL,S=WS,C=LK" -storepass mypassword -keypass mypassword
If the keystore name and password are changed, all the references to it within the configuration files must be updated as well. Run a grep command from the <IS_HOME> directory to find all the places within the WSO2 IS configuration files where the keystore name and password have been used.
Code Block grep -i -r wso2carbon.jks .
A list of configuration files that refer to "wso2carbon.jks" will be listed on your command prompt window. Open each file and update the keystore name, password, and alias values (e.g., update the keystore name from "
wso2carbon.jks
" to "newkeystore.jks
").Export the public key from your key store .jks file using the following command:
Code Block title Format keytool -export -alias <alias_name> -keystore <keystore_name>.jks -file <public_key_name>.pem
Replace the values enclosed in
<>
in the command given above with a value you prefer as shown in the sample command below.Code Block title Sample keytool command keytool -export -alias newcert -keystore newkeystore.jks -file pkn.pem
Import the public key you extracted in the previous step to the
client-truststore.jks
file using the following command:Code Block title Format keytool -import -alias <alias_name> -file <public_key_name>.pem -keystore client-truststore.jks -storepass <keystore_password>
Replace the values enclosed in
<>
in the command given above with a value you prefer as shown in the sample command below.Code Block title Sample keytool command keytool -import -alias newcert -file pkn.pem -keystore client-truststore.jks -storepass wso2carbon
Note If you create a new client-truststore, do a search using the
grep
command and change the name and passwords of the client-truststore in all the places in IS.Verfiy the hostname change by attempting to log into the dashboard, getting a token from any grant type, etc.
If you are trying this out on your local machine, open the etc/hosts/ file and add the following entry to map the new hostname. "is.dev.wso2.com" is used as an example in the sample entry shown below.
Code Block 127.0.0.1 is.dev.wso2.com
...