I'm working on Android application that call some web services from my server. I have created a Self-Signed Certificate
from IIS
to test calling API
s over https
but failed with SSLPeerUnverifiedException
exception.
I already ask a question on stackoverflow regarding this Call API on server that is signed using Self-Signed Certificate
After some digging and searching how to solve issue, I try the solution from following stackoverflow answer
When I try to read server certificate information using openssl
I get following Certificate chain:
Certificate chain
0 s:/CN=\x00S\x00S\x00_\x00C\x00E\x00M\x00_\x005\x00_\x004
i:/CN=\x00S\x00S\x00_\x00C\x00E\x00M\x00_\x005\x00_\x004
My server name is SS_CEM_5_4
, and above exception indicate that verifying host name failed.
Are these \x00
characters before each CN character is the problem, which lead to mismatch between certificate host name and server name?
I'm not sure what I'm doing wrong? Where should I start looking for the solution, generating certificate or my application?
Note: I create a new thread for this question to focus on certificate rather than my Android
application.