EddyVerbruggen / SSLCertificateChecker-PhoneGap-Plugin

:passport_control: Prevent Man in the Middle attacks with this Cordova plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Android 4.1.2 bug

jacobweber opened this issue · comments

When I use this to check a single cert on Android 4.1.2, on several devices, I get an error "Attempted to send a second callback for ID: SSLCertificateChecker778333821":

D/CordovaWebViewClient( 4347): onPageStarted(file:///android_asset/www/index.html)
D/CordovaActivity( 4347): onMessage(onPageStarted,file:///android_asset/www/index.html)
D/CordovaWebViewClient( 4347): onPageFinished(file:///android_asset/www/index.html)
D/CordovaActivity( 4347): onMessage(onPageFinished,file:///android_asset/www/index.html)
D/CordovaActivity( 4347): onMessage(spinner,stop)
D/CordovaNetworkManager( 4347): Connection Type: wifi
D/CordovaNetworkManager( 4347): Connection Extra Info: null
D/CordovaNetworkManager( 4347): Connection Type: wifi
D/CordovaNetworkManager( 4347): Connection Extra Info: null
D/CordovaActivity( 4347): onMessage(networkconnection,wifi)
W/CordovaPlugin( 4347): Attempted to send a second callback for ID: SSLCertificateChecker778333821
W/CordovaPlugin( 4347): Result was: "Invalid action"

Haven't tried it, but there's some info here:
http://stackoverflow.com/questions/25483286/cordova-how-to-write-native-plugins-that-can-repeatedly-invoke-a-javascript-cal

Seems to be caused when the plugin calls con.connect(), which throws an exception, and eventually results in the above error.

It looks like the newest version fixes this by running it in a new thread. Does that sound right?

That's strange - the only way to get the 'invalid action' message is when the plugins execute method returns false which it only does when an invalid action is used, not when an exception is thrown.

Perhaps the doc isn't entirely correct here. How are invoking the plugin exactly? Perhaps I can reproduce it.

Looks like I was using version 3.2 of the plugin, which does return false on an exception.

Ah, that makes sense. I guess we can close this then.