title: Installing SSL Certificate On Node Server
body: <p>I created a self-signed certificate and installed it on apache as well as on node.js(port 3000). On localhost both <code>https://localhost</code> and <code>https://localhost:3000</code> works well.</p>
  
  <p>So, I bought GoDaddy Standard SSL certificate and installed it on the server(<code>http://gatherify.com</code>). Now <code>https://gatherify.com</code> works well, but ssl on node isn't working. 
  When I access <code>https://gatherify.com:3000</code> i get "The connection was interrupted". </p>
  
  <p>I executed curl: </p>
  
  <pre><code>root@host [~]# curl -v -s -k https://gatherify.com:3000
  * About to connect() to gatherify.com port 3000 (#0)
  *   Trying 108.160.156.123... connected
  * Connected to gatherify.com (108.160.156.123) port 3000 (#0)
  * Initializing NSS with certpath: sql:/etc/pki/nssdb
  * warning: ignoring value of ssl.verifyhost
  * NSS error -5938
  * Closing connection #0
  * SSL connect error
  </code></pre>
  
  <p>Any suggestions to fix this?</p>
  
  <p><em><strong>UPDATE</em></strong>
  *<em>SERVER SIDE :</em>*</p>
  
  <pre><code>var io = require('socket.io'), 
      connect = require('connect'), 
      fs = require('fs'),
  
  var privateKey = fs.readFileSync('cert/server.key').toString();
  var certificate = fs.readFileSync('cert/server.crt').toString();
  
  var options = { 
      key: privateKey,
      cert: certificate
  };
  
  var app = connect(options).use(connect.static('../htdocs/node/'));
  app.listen(3000);
  var server = io.listen(app);
  
  server.sockets.on('connection', function(socket) { 
  console.log("Connected");
  });
  </code></pre>
  
  <p><strong>CLIENT SIDE:</strong> </p>
  
  <pre><code>&lt;html&gt; &lt;head&gt;
  
  &lt;script type = "text/javascript" src = "https://gatherify.com:3000/socket.io/socket.io.js"&gt;&lt;/script&gt;
  
  &lt;script type = "text/javascript"&gt;
  
  var socket = io.connect('https://gatherify.com:3000', {secure:true}); 
  
  &lt;/script&gt;
  
  &lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;
  </code></pre>