Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL Checker allowedfingerprint accepting only string #4788

Closed
sajid-robo opened this issue Jun 7, 2024 · 3 comments · Fixed by #4799
Closed

SSL Checker allowedfingerprint accepting only string #4788

sajid-robo opened this issue Jun 7, 2024 · 3 comments · Fixed by #4799

Comments

@sajid-robo
Copy link

I'm submitting a ... (check one with "x")

  • [x ] bug report

Current behaviour:
Currently the SSLChecker plugin is accepting allowedFingerprints as a string

Expected behaviour:
As per the Plugin Native implementation it will accept JSONArray. I will paste the below code for your reference. Please refer the highlighted code section below

Steps to reproduce:
Please refer the highlighted line

Related code:
public boolean execute(final String action, final JSONArray args, final CallbackContext callbackContext) throws JSONException {
if (ACTION_CHECK_EVENT.equals(action)) {
cordova.getThreadPool().execute(new Runnable() {
public void run() {
try {
final String serverURL = args.getString(0);
final JSONArray allowedFingerprints = args.getJSONArray(2);
final String serverCertFingerprint = getFingerprint(serverURL);
for (int j=0; j<allowedFingerprints.length(); j++) {
if (allowedFingerprints.get(j).toString().equalsIgnoreCase(serverCertFingerprint)) {
callbackContext.success("CONNECTION_SECURE");
return;
}
}
callbackContext.error("CONNECTION_NOT_SECURE");
} catch (Exception e) {
callbackContext.error("CONNECTION_FAILED");
//callbackContext.error("CONNECTION_FAILED. Details: " + e.getMessage());
}
}
});
return true;
} else {
callbackContext.error("sslCertificateChecker." + action + " is not a supported function. Did you mean '" + ACTION_CHECK_EVENT + "'?");
return false;
}
}

Other information:
https://github.com/EddyVerbruggen/SSLCertificateChecker-PhoneGap-Plugin/blob/master/src/android/nl/xservices/plugins/SSLCertificateChecker.java

@maniya108
Copy link

Hi, I am faced the same issue. Kindly assist the above issue. Thanks in advance

@maniya108
Copy link

Hi @danielsogl kindly help us to resolve the above issue

@sajid-robo
Copy link
Author

Thank you @fabiomartino and @danielsogl, your prompt action is appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants