Search code examples
wso2wso2-identity-server

Change localhost to hostname in wso2 is


Good day! I am trying to configure user invitation with email confirmation. Invited user accept email, but when he push 'confirm account' button he get an error. First there was a certificate error. but when I added the certificate, another error occurred. As I understand it, the error is quite logical, because the certificate was issued to our hostname. Is there any way to change localhost to our hostname? or are there other ways to solve this problem?

ERROR {org.wso2.carbon.identity.mgt.endpoint.util.client.ApiClient} - Error while performing the request method: POST on the resource: https://localhost:9443/api/identity/user/v1.0/validate-code com.sun.jersey.api.client.ClientHandlerException: javax.net.ssl.SSLHandshakeException: No subject alternative DNS name matching localhost found.

Editing RecoveryEndpointConfig.properties in repository/deployment/server/webapps/accountrecoveryendpoint/ dont solve this problem


Solution

  • You can configure the hostname by adding the following entry to the <IS_HOME>/repository/conf/deployment.toml config file,

    [server]
    hostname = "your_host_name"
    

    Since by default IS uses localhost as the internal hostname, you will need to add it as a SAN for the certificate.

    Another option is to define the hostname and internal_hostname both in the toml config as below,

    [server]
    hostname = "your_host_name"
    internal_hostname = "your_host_name"
    

    You may refer to the following official documentation to get a detail understanding of changing the hostname

    https://is.docs.wso2.com/en/latest/deploy/change-the-hostname/