by Eddy Verbruggen for PhoneGap 3.0.0 and up.
- Description
- Installation 2. Automatically (CLI / Plugman) 2. Manually 2. PhoneGap Build
- Usage
- Credits
- License
Need SSL Pinning? | If checking the certificate manually isn't sufficient for your needs and you want to be absolutely positive each and every HTTPS request is sent to your server, then take a look at the Secure HTTP plugin. |
This plugin can be used to add an extra layer of security by preventing 'Man in the Middle' attacks. When correctly used, it will be very hard for hackers to intercept communication between your app and your server, because you can actively verify the SSL certificate of the server by comparing actual and expected fingerprints.
You may want to check the connection when the app is started, but you can choose to invoke this plugin everytime you communicate with the server. In either case, you can add your logic to the success and error callbacks.
- This version is for PhoneGap 3.0 and higher.
- PhoneGap 2.9 and lower is available in the pre-phonegap-3 tree.
- Compatible with Cordova Plugman.
- Officially supported by PhoneGap Build.
SSLCertificateChecker is compatible with Cordova Plugman and compatible with PhoneGap 3.0 CLI, here's how it works with the CLI:
$ phonegap local plugin add https://github.com/EddyVerbruggen/SSLCertificateChecker-PhoneGap-Plugin.git
or
$ cordova plugin add https://github.com/EddyVerbruggen/SSLCertificateChecker-PhoneGap-Plugin.git
Run cordova prepare
or cordova build
afterwards.
1. Add the following xml to your config.xml
:
<!-- for iOS -->
<feature name="SSLCertificateChecker">
<param name="ios-package" value="SSLCertificateChecker" />
</feature>
<!-- for Android -->
<feature name="SSLCertificateChecker">
<param name="android-package" value="nl.xservices.plugins.SSLCertificateChecker" />
</feature>
2. Grab a copy of SSLCertificateChecker.js, add it to your project and reference it in index.html
:
<script type="text/javascript" src="js/SSLCertificateChecker.js"></script>
3. Download the source files for iOS and/or Android and copy them to your project.
Android:
- Copy
SSLCertificateChecker.java
toplatforms/android/src/nl/xservices/plugins
(create the folders)
iOS:
- Add a dependency to
Security.framework
: Go to Your project > Build Phases > Link binaries with libraries > Click+
> Security.framework. - Copy
SSLCertificateChecker.*
toplatforms/ios/<ProjectName>/Plugins
.
Using SSLCertificateChecker with PhoneGap Build requires these simple steps:
1. Add the follow