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

Error in Android 4.4.4 when making https request #12

Closed IJRS closed 7 years ago

IJRS commented 7 years ago

When I make a request on a device running Android 5.0.1 it works correctly but in Android 4.4.4 I get an error, any solution? Error obtained: Https.request error javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x72699f10: Failure in SSL library, usually a protocol error error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure (external/openssl/ssl/s23_clnt.c:741 0x39fa31e3:0x00000000)

roblav96 commented 7 years ago

@IJRS add this:

application.android.on(application.AndroidApplication.activityCreatedEvent, function(args: application.AndroidActivityBundleEventData) {
    let policy = new android.os.StrictMode.ThreadPolicy.Builder().permitAll().build()
    android.os.StrictMode.setThreadPolicy(policy)
})
IJRS commented 7 years ago

@roblav96

I already have integrated this function in my project, which works for android versions >= 5.0, but for versions <5.0 does not work (in my case it is the android version 4.4.4) ..