title: nodejs - change https server certificate
body: <p>I am working on a https proxy and I need to change the https certificate on the fly. For example:</p>
  
  <ol>
  <li>a client request www.google.com</li>
  <li>the https server(proxy) must create a certificate with CommonName = www.google.com</li>
  <li>the https server must send this certificate to client</li>
  </ol>
  
  <p>The https server takes as parameters the key and certificate, but I don't need a static certificate, I need to change the certificate on every different request.</p>
  
  <p>Any ideas?</p>