how to generate ssl certificate for https on localhost ubuntu 18.04 code example
Example: create self signed certificate for localhost ubuntu
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/apache-selfsigned.key -out /etc/ssl/certs/apache-selfsigned.crt