diff --git a/CHANGELOG.md b/CHANGELOG.md index 906c1fc..335d0fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 2.5.0 + +- Feature #56: add support for X.509 client certificate based authentication + ## 2.4.1 - Fixed #296: multipart requests are not serialized on browser platform diff --git a/README.md b/README.md index b7458e0..4135de8 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ This is a fork of [Wymsee's Cordova-HTTP plugin](https://github.com/wymsee/cordo - SSL / TLS Pinning - CORS restrictions do not apply + - X.509 client certificate based authentication - Handling of HTTP code 401 - read more at [Issue CB-2415](https://issues.apache.org/jira/browse/CB-2415) ## Updates @@ -186,6 +187,29 @@ cordova.plugin.http.setServerTrustMode('nocheck', function() { }); ``` +### setClientAuthMode +Configure X.509 client certificate authentication. Takes mode and options. `mode` being one of following values: + +* `none`: disable client certificate authentication +* `systemstore` (only on Android): use client certificate installed in the Android system store; user will be presented with a list of all installed certificates +* `buffer`: use given client certificate; you will need to provide an options object: + * `rawPkcs`: ArrayBuffer containing raw PKCS12 container with client certificate and private key + * `pkcsPassword`: password of the PKCS container + +```js + // enable client auth using PKCS12 container given in ArrayBuffer `myPkcs12ArrayBuffer` + cordova.plugin.http.setClientAuthMode('buffer', { + rawPkcs: myPkcs12ArrayBuffer, + pkcsPassword: 'mySecretPassword' + }, success, fail); + + // enable client auth using certificate in system store (only on Android) + cordova.plugin.http.setClientAuthMode('systemstore', {}, success, fail); + + // disable client auth + cordova.plugin.http.setClientAuthMode('none', {}, success, fail); +``` + ### disableRedirect (deprecated) This function was deprecated in 2.0.9. Use ["setFollowRedirect"](#setFollowRedirect) instead. diff --git a/package.json b/package.json index 8548a50..c29ce3d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-advanced-http", - "version": "2.4.1", + "version": "2.5.0", "description": "Cordova / Phonegap plugin for communicating with HTTP servers using SSL pinning", "scripts": { "updatecert": "node ./scripts/update-e2e-server-cert.js && node ./scripts/update-e2e-client-cert.js", @@ -69,4 +69,4 @@ "wd": "1.4.1", "xml2js": "0.4.19" } -} +} \ No newline at end of file