title: How to access the OpenShift wildcard SSL certificate and private key
body: <p>On the OpenShift website here: <a href="https://help.openshift.com/hc/en-us/articles/202535440-How-do-I-get-SSL-for-my-domains-" rel="noreferrer">https://help.openshift.com/hc/en-us/articles/202535440-How-do-I-get-SSL-for-my-domains-</a>, it states</p>
  
  <pre><code>You can always take advantage of our *.rhcloud.com wildcard certificate in order 
  to securely connect to any application via it's original, OpenShift-provided 
  hostname URL.
  </code></pre>
  
  <p>However, Node's HTTPS server requires a file path to a certificate and private key in order to use HTTPS:</p>
  
  <pre><code>var privateKey  = fs.readFileSync('sslcert/server.key', 'utf8');
  var certificate = fs.readFileSync('sslcert/server.crt', 'utf8');
  var credentials = {key: privateKey, cert: certificate};
  var express = require('express');
  var app = express();
  var httpsServer = https.createServer(credentials, app);
  httpsServer.listen(443);
  </code></pre>
  
  <p>None of the OpenShift environment variables (<a href="https://www.openshift.com/developers/openshift-environment-variables" rel="noreferrer">https://www.openshift.com/developers/openshift-environment-variables</a>) appear to be related to SSL certificates, and the documentation does not mention it other than at the above link, which provides no technical information in actually using it.</p>
  
  <p>How do I access the privateKey and certificate file on an OpenShift Node.js gear/cartridge?</p>