On Thu, Aug 2, 2012 at 5:27 PM, thstart <[email protected]> wrote:
> Install GoDaddy SSL certificate with Node.js
>
> I want to use https for my web app which is running on Microsoft
> Azure.
>
> I used IIS to generate certificate for GoDaddy then downloaded two files:
> <domain name>.crt
> gd_iis_intermediates.p7b
> Then I followed procedures described in GoDaddy to export and password
> protect my <domain name>.pfx certificate. Uploaded to MS Azure now my site
> is serving https only.
>
> Now I need to use https.createServer(options, [requestListener]) as
> described in:
> http://nodejs.org/api/https.html
>
> // curl -k https://localhost:8000/
> var https = require('https');
> var fs = require('fs');
>
> var options = {
>   key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
>   cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
> };
>
> https.createServer(options, function (req, res) {
>   res.writeHead(200);
>   res.end("hello world\n");
> }).listen(8000);
>
>
>
> There is not a key when I am using IIS so I have to extract
> it from the .pfx and remove the password or to use the .pfx
> directly (which needs a password). How is the right way to
> handle this?
>
>
> var https = require('https');
> var fs = require('fs');
>
> var options = {
>   pfx: fs.readFileSync('server.pfx')
> };
>
> https.createServer(options, function (req, res) {
>   res.writeHead(200);
>   res.end("hello world\n");
> }).listen(8000);

You probably need to pass in a pass phrase. Have a look at the test case:

https://github.com/joyent/node/blob/50e00de/test/simple/test-https-pfx.js

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to