I have a PHP application which runs on production like this :
<?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");
}
?>
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 ?
/* Development example with workarounds */
<?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");
}
?>
How can I install a temporary certificate for development purpose ? Or somehow fake the environment .