title: Node.js Using SSL Wildcard Breaks on Mobile
body: <p>I've got a Node.js server that runs on sub.domain.com, using SSL.  It's been working perfectly for months on desktop browsers, but I just noticed that it doesn't work on mobile browsers.</p>
  
  <p>I've done a bit of research and there's a lot of people suggesting that there is something wrong with my certificate chain.  I've changed my code to look like there's but still no luck.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>var httpsOptions = {
      ca: [fs.readFileSync("certrequest.csr")],
      key: fs.readFileSync("privatekey.pem"),
      cert: fs.readFileSync("certificate.pem")
  };
  
  var app = http.createServer(httpsOptions, function(req, res) {
      log.cnsl.write("HTTP Request received from " + req.connection.remoteAddress);
          //Do stuff
  });
  </code></pre>
  
  <p>I'm running this command to view some debug information (my server runs on port 5673):</p>
  
  <pre><code>openssl s_client -connect sub.domain.com:5673 -showcerts | grep "^ "
  </code></pre>
  
  <p>Below is the important part of that output</p>
  
  <pre><code>depth=0 O = *.domain.com, OU = Domain Control Validated, CN = *.domain.com
  verify error:num=20:unable to get local issuer certificate
  verify return:1
  depth=0 O = *.domain.com, OU = Domain Control Validated, CN = *.domain.com
  verify error:num=27:certificate not trusted
  verify return:1
  depth=0 O = *.domain.com, OU = Domain Control Validated, CN = *domain.com
  verify error:num=21:unable to verify the first certificate
  verify return:1
  </code></pre>