EddyVerbruggen / SSLCertificateChecker-PhoneGap-Plugin

:passport_control: Prevent Man in the Middle attacks with this Cordova plugin
MIT License
155 stars 89 forks source link

Error with PhoneGap url. #51

Open oswaldo89 opened 5 years ago

oswaldo89 commented 5 years ago

even with the example URL, from the phonegap server I get the message > CONECTION_NOT_SECURE, i used the correct fingerprint from the phonegap server.

    $ionicPlatform.ready(function(){
        var server = "https://build.phonegap.com";
        var fingerprint = "C6 2D 93 39 C2 9F 82 8E 1E BE FD DC 2D 7B 7D 24 31 1A 59 E1 0B 4B C8 04 6E 21 F6 FA A2 37 11 45";

        window.plugins.sslCertificateChecker.check(successCallback,errorCallback,server,fingerprint);

         function successCallback(message) {
           alert(message);
         }

         function errorCallback(message) {
           alert(message);
           if (message === "CONNECTION_NOT_SECURE") {
             // There is likely a man in the middle attack going on, be careful!
           } else if (message.indexOf("CONNECTION_FAILED") >- 1) {
             // There was no connection (yet). Internet may be down. Try again (a few times) after a little timeout.
           }
         }
   })

i compiled on android device. any suggestion? ?

EddyVerbruggen commented 5 years ago

I can only imagine you're not using the latest version of the plugin.

oswaldo89 commented 5 years ago

I add plugin with this command > cordova plugin add cordova-plugin-sslcertificatechecker

the version in package.json is > 6.0.0