How to fix No subject alternative names present - Little Big Extra Skip to main content

How to fix No subject alternative names present

How to fix No subject alternative names present


In this article, we will focus on how to resolve the SSLHandshakeException and possible cause behind it. If you are getting below error, let’s find out how to resolve it. No subject alternative names presentat

Cause of error

SSL Handshake Exception

The reason, we get above error is that CN(Common name) defined in your certificate is not matching with the domain the application is running on.
For e.g, In your certificate, the CN name is defined as but you may be running the application say a URL which is like http://localhost:8080/api

How to fix the above error

There are 2 easy ways to fix the above error

Use this Command to check what is the CN name defined in your certificate

You should get some response like this

Pay close attention to the first line in above output, if you are running the application from the above domain, you should not encounter the above error.

So to fix the above error simply use one of the below approaches

  • Run the application on the same ‘CN’, as defined in your certificates.


  • Along with CN name you can add Subject alt names in your certificate, which is like adding more than one domain in the certificate. Link below describes the process of adding multiple domains(subject-alt-name) to jks file and also to a certificate.

Related Posts

One thought to “How to fix No subject alternative names present”

  1. Hi, it’s been three days I got to know about this site. And I’m absolutely loving all the solutions.
    Major thanks! Please keep posting �?

Leave a Reply

Your email address will not be published. Required fields are marked *