forked from silkimen/cordova-plugin-advanced-http
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: implementing X509 client cert authentication (android "buffer" m…
…ode)
- Loading branch information
Sefa Ilkimen
committed
Apr 15, 2019
1 parent
620ce3f
commit 4f3ff90
Showing
14 changed files
with
449 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const fs = require('fs'); | ||
const https = require('https'); | ||
const path = require('path'); | ||
|
||
const SOURCE_URL = 'https://badssl.com/certs/badssl.com-client.p12'; | ||
const TARGET_PATH = path.join(__dirname, '../test/e2e-app-template/www/certificates/badssl-client-cert.pkcs'); | ||
|
||
const downloadPkcsContainer = (source, target) => new Promise((resolve, reject) => { | ||
const file = fs.createWriteStream(target); | ||
|
||
const req = https.get(source, response => { | ||
response.pipe(file) | ||
resolve(target); | ||
}); | ||
|
||
req.on('error', error => { | ||
return reject(error) | ||
}); | ||
|
||
req.end(); | ||
}); | ||
|
||
console.log(`Updating client certificate from ${SOURCE_URL}`); | ||
|
||
downloadPkcsContainer(SOURCE_URL, TARGET_PATH) | ||
.catch(error => { | ||
console.error(`Updating client certificate failed: ${error}`); | ||
process.exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.