Hostname verification is enabled in WSO2 products by default, which means that when a hostname is being accessed by a particular client, it will be verified against the hostname specified in the product's SSL certificate.
Carbon 4.4.10 introduced a new property (
.hostnameVerifier) for the purpose of configuring the default hostname verification setting in a Carbon server. Therefore this possibility is available for all WSO2 products that are based on Carbon Kernel 4.4.10 or later versions. You can add this property to the product's startup script (
wso2server.sh for Linux and
wso2server.bat for Windows), which is stored in the
<PRODUCT_HOME>/bin directory and add a property value as shown below. The value you set for this property will determine how hostname verification will work for your server. The property will be effective during server startup.
The values you can use with this property are explained below. If none of these values are specified, the default mode will be effective:
- Strict: When this mode is enabled, hostnames will be strictly verified against the hostname specified in the product's SSL certificate. For example, if "*.foo.com" is specified as the hostname in the certificate, only the hostnames at the same level will be authorized. That is, subdomains such as "a.b.foo.com" will not be authorized.
- AllowAll: This option turns off hostname verification for the server. Note that this is not recommended in a production setup and should only be used for demonstrations and testing.
- DefaultAndLocalhost: This option works the same as the default mode, except that the following hostnames will not be verified against the hostname in the certificate: "localhost", "localhost.localdomain", "127.0.0.1", "::1". That is, these hostnames will be allowed regardless of the server's certificate.
These values will behave the same as synapse host name verification options.