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

undefined return, no alert go off

jegsar opened this issue · comments

Just not doing anything, running on phonegap 3.4 on iOS 6.1

here is console log when i try to make calls via the console. No alerts pop up, no errors, no nothing other then an undefined return.

successCallback('test'); pops up an alert. so does errorCallback('test');

window.plugins.sslCertificateChecker.check(
successCallback,
errorCallback,
"https://google.com",
"‎9b 4c 03 99 61 82 4f ec ea 00 61 7b 87 9b 6b c7 ce 10 bf 09");
undefined
window.plugins.sslCertificateChecker.check;
function (successCallback, errorCallback, serverURL, allowedSHA1Fingerprint, allowedSHA1FingerprintAlt) {
if (typeof errorCallback != "function") {
console.log("SSLCertificateChecker.find failure: errorCallback parameter must be a function");
return
}

if (typeof successCallback != "function") {
console.log("SSLCertificateChecker.find failure: successCallback parameter must be a function");
return
}
cordova.exec(successCallback, errorCallback, "SSLCertificateChecker", "check", [serverURL, allowedSHA1Fingerprint, allowedSHA1FingerprintAlt]);
}
successCallback;
function successCallback(message) {
alert(message);
// Message is always: CONNECTION_SECURE.
// Now do something with the trusted server.;
}
errorCallback;
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 == "CONNECTION_FAILED") {
   // There was no connection (yet). Internet may be down. Try again (a few times) after a little timeout.

 }

}

Hi, just tested the plugin again on iOS 6.1 and all works fine. Can you verify you have the plugin in your config.xml and that you're waiting for deviceready to fire before using the plugin?

If you need further assistance please drop me an email with your XCode project attached at eddyverbruggen[at]gmail.com, thanks!

I do wait for device read, and i try manually much later.

I have it included in the config. as you can see when i run "window.plugins.sslCertificateChecker.check;" from the console it outputs the function code meaning that it does get wrapped into the package.

I use phonegap build to build&deploy with a signed developer key, that may have something to do with it though I have tired to run

This particular project is private but I can try to duplicate the issue on an open source project if that would help.

Hi,

Can you compare your project to this one? It's a working one and ready to
pull into Phonegap Build:
https://github.com/EddyVerbruggen/X-Services-PhoneGap-Build-Plugins-Demo

Best,
Eddy

2014-06-01 3:21 GMT+02:00 jegsar notifications@github.com:

I do wait for device read, and i try manually much later.

I have it included in the config. as you can see when i run
"window.plugins.sslCertificateChecker.check;" from the console it outputs
the function code meaning that it does get wrapped into the package.

I use phonegap build to build&deploy with a signed developer key, that may
have something to do with it though I have tired to run

This particular project is private but I can try to duplicate the issue on
an open source project if that would help.


Reply to this email directly or view it on GitHub
#11 (comment)
.