I am trying to use the safari-push-notifications npm (https://www.npmjs.com/package/safari-push-notifications) to generate the push package for safari push notifications.
I followed these instructions to prepare my cert.pem and key.pem https://github.com/node-apn/node-apn/wiki/Preparing-Certificates.
When I trigger the route that is trying download my push package, I am prompted for the PEM passphrase. I tried stripping the passphrase from the key.pem with openssl rsa -in key.pem -out key2.pem, but I am still being prompted by the server when that route is hit.
Here is the post route that I have been referring to:
// SAFARI
app.post('/v1/pushPackages/:websitePushID', function(req, res) {
console.log("route was hit");
pushLib.generatePackage(
websiteJson, // The object from before / your own website.json object
path.join('assets', 'safari_assets'), // Folder containing the iconset
cert, // Certificate
key, // Private Key
intermediate // Intermediate certificate
)
.pipe(fs.createWriteStream('pushPackage.zip'))
.on('finish', function () {
console.log('pushPackage.zip is ready.');
res.sendFile('pushPackage.zip');
});
})
Here is the output:
route was hit
Enter PEM pass phrase:
How do I stop this?
via msibilsk
No comments:
Post a Comment