title: How to simulate a https environment/SSL certificate for development environment ?
body: <p>I have a PHP application which runs on production like this :</p>
  
  <pre><code>&lt;?php
  
      /*
      Do some work here
      */
  
      /* if https environment, redirect to secure next url */
      if(empty(isset["HTTPS"]) == true )  /* FIRST DEPENDECY */
      {
        header("location : https://mynext_prod_url?parameters"); /*SECOND DEPENDENCY */
      }
      else
      {
         header("location : http://mynext_prod_url?parameters");
      }
  ?&gt;
  </code></pre>
  
  <p>This works absolutely fine in production where a SSL certificate is installed.
  To simulate the same scenarios in development, I can overcome first dependency,
  but how shall I overcome the second ?</p>
  
  <p>/* Development example with workarounds */</p>
  
  <pre><code>  &lt;?php
  
          /*
          Do some work here
          */
          $_SERVER['HTTPS'] = "TRUE" ;         /* fake HTTPS  */   
  
          if(isset($_SERVER["HTTPS"]) == true )  /* FIRST DEPENDECY SOLVED */
          {
            /* BUT THIS URL DOES NOT WORK AS IT ONLY EXISTS ON HTTP */
            header("location : https://mynext_dev_url?parameters"); 
          }
          else
          {
             header("location : http://mynext_dev_url?parameters");
          }
      ?&gt;
  </code></pre>
  
  <p>How can I install a temporary certificate for development purpose ?
  Or somehow fake the environment .</p>