nativescript-community / https

Secure HTTP client with SSL pinning for Nativescript - iOS/Android
https://nativescript-community.github.io/https/
Other
50 stars 42 forks source link

The android side is not working as expected. #3

Open pitAlex opened 7 years ago

pitAlex commented 7 years ago

On the android platform I see several issues: 1) It will throw javax.net.ssl.SSLPeerUnverifiedException: Hostname not verified when using an intermediate certificate. Workaround is to disable validatesDomainName. 2) It will try to convert the response into a json no matter what it is. This makes it impossible to determine if the request failed because of a 500, a 404 or a 403. 3) It should not try to convert the response into json even if its a 200, just like in ios. If you can't provide a "getJSON" method its best to let the developer parse the response how he needs it. Just give: { content: "raw content", statusCode: statusCode, headers: headers }

roblav96 commented 7 years ago

In the current state the plugin is only meant to work with basic APIs. I'll have to publish a new update soon as I've improved this over time.