Open Guatom opened 6 years ago
Hey @roblav96! Any chance for this to get merged?
Thanks in advance.
@Guatom You mentioned, that Android requires a SAN value for self-signed certificates. I can't find any information or documentation for this. Do you by any chance have a source for this info? Thanks in advance!
@jjonly sorry my friend! I don't know why I hadn't been notified about this. Do you still need help?
This fixes the following problem:
A couple of months ago, Android stopped accepting self-signed certificates without SAN value when performing a WS call. I took a look at nativescript-https's code and there's this option
validatesDomainName
: iffalse
, it uses default Android hostname verification which throws the mentioned error; iftrue
, it uses a custom hostname verifier.With my proposed change, the custom verifier will always be used, but it will return
true
ifvalidatesDomainName === false
and will use current logic ifvalidatesDomainName === true
. This can be returned some lines before, just at the beginning ofverify
and save some processing, but I think it looks fancier this way. I'll modify the code if needed.I used this for a development environment and I thought it was useful since I saw some people having the same problem. I think this could be useful for someone else.
Best regards from
_travelDevs
.