I am using the php server from windows cmd. I generated ssl certificate and key using openssl. and started a php server by using the command provided below. but still https is not working. server is starting with the http protocol.
I want to use the https protocol with these self signed certificate in php server.
php -S localhost:8000 -t "C:/Users/Pro/Desktop/Web Development/php" -d "C:Program FilesOpenSSL-Win64binopenssl.cfg" -ssl "C:/Users/Pro/Desktop/Web Development/php/openssl/server.crt" -ssl-key "C:/Users/Pro/Desktop/Web Development/php/openssl/server.key"
this is the command.
2
Answers
I installed the stunnel latest version which is 5.69. Then I created the config file for stunnel and save this with stunnel.conf extension; Stunnel configuration for PHP built-in server
Started stunnel with:
now I am listening to port localhost:443 and it is redirecting to port localhost:800:
Maybe try adding
stunnel3 -d 443 -r 8000
?For example:
php -S localhost:8000 -t "C:/Users/Pro/Desktop/Web Development/php" -d "C:Program FilesOpenSSL-Win64binopenssl.cfg" -ssl "C:/Users/Pro/Desktop/Web Development/php/openssl/server.crt" -ssl-key "C:/Users/Pro/Desktop/Web Development/php/openssl/server.key" | stunnel3 -d 443 -r 8000