The aim of this article is to provide a solution for "No subject alternative names present" exception when calling SSL Enabled (HTTPS endpoint)
Caused by: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192) ~[?:1.8.0_77]
...
Caused by: java.security.cert.CertificateException: No subject alternative names present
at sun.security.util.HostnameChecker.matchIP(HostnameChecker.java:144) ~[?:1.8.0_77]
...
You are not supposed to use IP address in CN when creating a certificate for your SSL endpoint, you need to set CN to the hostname (sample.com). In order to serve requests that using IP address, you can use the subject alternative name (san) for this purpose to add IP Address (static ip) of the application to certificate's extensions.
You can use the following syntax to generate a self-signed keypair, in this sample application is called "sample.com" with public ip "ip:53.63.109.45". Using this certificate, client applications can call the exposed endpoint using both public IP and sample.com.
keytool -genkeypair -v -alias mbh -keystore keystore-ssl.jks -storepass mani1234 -keypass mani1234 -keyalg RSA -storetype JKS -validity 2000 -keysize 2048 -dname "CN=sample.com, OU=Support, O=Mulesoft, L=Syd, ST=NSW, C=AU" -ext san=ip:53.63.109.45
001114640

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.