Hmm since the code looks right to me ( I haven't copied your code and tried)

so, what I suggest is to check the following:
1) check if privateKey, and other two variables contain values.
2) try to do a curl with localhost, e.g. localhost:PORT and see if it works
3) check if your server has opened the port to public.
4) remove all certs, and just create a HTTP server.  Try if you can curl
it.  and try if you create your http server with that specific PORT number,
and try curl.

On Mon, Jan 14, 2013 at 3:59 AM, vaibhav mande <[email protected]>wrote:

> Hi murvinlai,
>
> Thanks for the reply.
> I tried removing toString as you suggested, also I read the question you
> posted as stackoverflow but still cant get it working.
> Please let me know if you find anything else related to this which i can
> try to get this working.
>
>
> On Friday, 11 January 2013 01:00:07 UTC+5:30, murvinlai wrote:
>
>> the code looks right to me.  (i asked that question a while ago in
>> stackoverflow http://**stackoverflow.com/questions/**
>> 11804202/how-to-setup-a-ssl-**cert-in-express-js-server-now<http://stackoverflow.com/questions/11804202/how-to-setup-a-ssl-cert-in-express-js-server-now>
>> )**
>>
>> Hmm or you can try fs.readFileSync("....")  without toString()
>>
>>
>>
>> On Tue, Jan 8, 2013 at 4:11 AM, vaibhav mande <[email protected]>wrote:
>>
>>>
>>> Hello,
>>>
>>> I Am trying to implement node server with https, but facing some
>>> problems.
>>>
>>> This is what I have done so far :-
>>>
>>> I submitted csr to geotrust and got crt and intermediate bundle crt.
>>>
>>> My current node.js code :-
>>>
>>> var fs = require('fs');
>>> var privateKey = 
>>> fs.readFileSync('/path_to_**certificate/xxx.doamin.com.**key').toString();
>>> var certificate = 
>>> fs.readFileSync('/path_to_**certificate/xxx.domain.com.**crt').toString();
>>> var cacert = 
>>> fs.readFileSync('/path_to_**certificate/xxx.domain.com.gd_**bundle.crt').toString();
>>>
>>> var express = require('express')
>>>    , io = require('socket.io')
>>>    , app = express()
>>>    , server = require('https').createServer(**{key: privateKey, cert: 
>>> certificate, ca:cacert}, app);
>>>    , io = io.listen(server)
>>>
>>> server.listen(PORT);
>>>
>>> app.get('/', function (req, res){
>>>          fs.readFile(__dirname + '/socket_loader.html',
>>>          function (err, data){
>>>          if (err){
>>>                  res.writeHead(500);
>>>              return res.end('Error loading socket loader.html');
>>>          }
>>>          res.writeHead(200);
>>>          res.end(data);
>>>          });
>>> });
>>>
>>> When I Am trying to connect using curl, this is the error I get :-
>>>
>>> # curl -vsk https://xxx.domain.com:PORT
>>> * About to connect() to xxx.domain.com port 'PORT' (#0)
>>> *   Trying xx.xx.xx.xx... connected
>>> * Connected to xxx.domain.com (xx.xx.xx.xx) port 'PORT' (#0)
>>> * Initializing NSS with certpath: sql:/etc/pki/nssdb
>>> * warning: ignoring value of ssl.verifyhost
>>> * NSS error -5938
>>> * Closing connection #0
>>> * SSL connect error
>>>
>>> Any help on this matter will be appreciated.
>>> Thank you,
>>> Vaibhav Mande
>>>
>>>  --
>>> Job Board: http://jobs.nodejs.org/
>>> Posting guidelines: https://github.com/joyent/**node/wiki/Mailing-List-*
>>> *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
>>> nodejs+un...@**googlegroups.com
>>>
>>> For more options, visit this group at
>>> http://groups.google.com/**group/nodejs?hl=en?hl=en<http://groups.google.com/group/nodejs?hl=en?hl=en>
>>>
>>
>>  --
> 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
>

-- 
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