Following this link , based on the accepted answer, the reason behind it is because the SSL certificate was generated for a completely different key pair.
But I don't think I generated it with a different key pair.
this is how I did it.
generate keystore:
keytool -keysize 2048 -genkey -alias tomcat -keyalg RSA -keystore pbsks.keystore
generate CSR:
keytool -certreq -keyalg RSA -alias tomcat -file csr.csr -keystore pbsks.keystore
use the generated csr to request certificate, then I received the file.
import the root ca, intermed and issued cert.
keytool -import -alias root -keystore pbsks.keystore -trustcacerts -file root.crt
keytool -import -alias intermed -keystore pbsks.keystore -trustcacerts -file intermed.crt
keytool -import -alias tomcat -keystore pbsks.keystore -trustcacerts -file issuedcert.crt.pem
Why is this happening?