Welcome, Guest!!

Date: Tue, Jan 21st 2025
Time:

  Login Join GTK
 
 

How to set up HTTPS on localhost or local server made simple

Topic Started By: goddy       Created: Nov 6th, 2023, 2:40 pm


I didn’t think that there will be a time where websites would be saying if you don’t have a website that is not on HTTPS server then you may not be able to use our services. So, I experienced that myself and you too will experience that at one point or the other as you go in your Web Development journey.

I thank God for the OpenSSL project that has provided us with this powerful tool to be able to achieve this task. So, without further ado, let's get started.

Any version of WampServer can be used in this setup.

Today, we are going to learn how to set up HTTPS on your localhost. Let me tell you briefly why I am recording this video. I wanted to integrate a payment gateway into my website, and I needed to test it on my localhost before going live. The company website requires that the test be done on an HTTPS website, so I started looking for guides. Most of the guides I found were not comprehensive enough, and some did not zoom for proper viewing. Then, fortunately, I came across a guide that gave me 80% of the understanding, and I decided to record this video to give you 100% understanding and clarity. So, without further ado, let's get started.

You may like to watch the video below or follow the step-by-step approach:

  1. Go to WampServer website and download and install it. You can click here to do that.
  2. OpenSSL can be used on Command Prompt to create the SSL certificate and private key. You can get it for win 32 and 64. Download the version based on your system here. On the download page, scroll down to the section as shown in the image below:
  3. Let's create a Private Key, click Start button on your computer, type cmd or comm, right-click on Command Prompt and select Run as administrator. While the Command Prompt is still opened, go to the location you installed the OpenSSL, copy the line below and paste if the location is the same as yours and click Enter line to copy: cd C:\Program Files\OpenSSL-Win64\bin

    Create a private key by copying and pasting each of the lines below and clicking Enter key each time you copy and paste, when asked for pass phrase, it can be any number of characters you like, e.g., 1234:

    openssl genrsa -aes256 -out private.key 2048

    openssl rsa -in private.key -out private.key 

  4. Let's create an SSL Certificate by entering following command on the Command Prompt, read and answer any questions being asked, see image below as sample: this is line to copy: openssl req -new -x509 -nodes -sha1 -key private.key -out certificate.crt -days 36500
  5. Now, we are moving/cutting the Private Key and the Certificate files, which are certificate.crt and private.key created in this location: C:\Program Files\OpenSSL-Win64\bin. See steps 3 and 4 above. Create a new folder with related name called ssl in your server location, e.g.: C:\wamp\bin\apache\apache2.4.9\conf, then paste those two files you copied into the ssl folder.
  6. Let’s configure the httpd.conf file, go to C:\wamp\bin\apache\apache2.4.9\conf\httpd.conf (depending on your WampServer installed drive), open the httpd.conf file with any text editor of choice, uncomment that is, remove the hash # symbol behind each of the 3 lines below, you copy each line, then Ctr+F to find: line 1: LoadModule ssl_module modules/mod_ssl.so        line 2:  Include conf/extra/httpd-ssl.conf         line 3:    LoadModule socache_shmcb_module modules/mod_socache_shmcb.so              Save the file or press Ctr+S when you are done.
  7. Next, configure the httpd-ssl.conf file, go to C:\wamp\bin\apache\apache2.4.9\conf \extra\httpd-ssl.conf, open file with any text editor, add the lines below if they don't exist or modify if they exist, you copy first word on each line, then Ctr+F to find, replace each path/location that relates to your system, e.g., c:/wamp/, c:/wamp/bin/apache/apache2.4.9 etc.
  8. Copy and search each line:

    DocumentRoot "c:/wamp/www"

    ServerName localhost:443

    ServerAdmin admin@example.com

    SSLCertificateKeyFile "c:/wamp/bin/apache/apache2.4.9/conf/ssl/private.key"

    SSLCertificateFile "c:/wamp/bin/apache/apache2.4.9/conf/conf/ssl/certificate.crt"

    SSLSessionCache "shmcb:c:/wamp/bin/apache/apache2.4.9/logs/ssl_scache(512000)"

    CustomLog "c:/wamp/bin/apache/apache2.4.9/logs/ssl_request.log" \

              "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"                   >  Save the file or press Ctr+S when you are done.

  9. Last but not least, restart the WampServer, if the icon turns green, then everything is OK. If the icon turns orange or red, there is a problem with your server configuration somewhere. Check for any syntax errors by going to this location on your Command Prompt: C:\wamp\bin\apache\apache2.4.9\bin and run this command: httpd -t if it shows errors, go through the errors and fix them but if it shows Syntax OK, then you are done.
    Test what you have done by going to https://localhost or https://127.0.0.1 on your browser software, if a warning page appears, then see the steps in the image below to fix it.

If you find this post useful, help me smash the like button, comment, share with your friends, and you can also share your content on this website by registering free here. Thanks, and take care!

Check link below to download PDF of this post

How to set up HTTPS on localhost or local server made simple

×
How to set up HTTPS on localhost or local server made simple

Click to download or open this file: 23-11-7-639-how-to-set-up-https-on-localhost.pdf

×

Subscribe to get notifications when I create new topics by clicking the SUBSCRIBE button at the top of this page if you have not already subscribed. Thanks.




Related Topic (s) in Programming section.

SUI Meme Coin Development The Next Big Thing in Crypto?

SUI Meme Coin Development The Next Big Thing in Crypto?

27 views4 days ago

SUI Memecoins are exploding in popularity thanks to the SUI blockchain's robust infrastructure.  ...[Read more]


The Blinkit Business Model: A Blueprint for Success

The Blinkit Business Model: A Blueprint for Success

41 views2 weeks ago

Explore the Blinkit business model and discover how it powers success in the grocery delivery ...[Read more]


Launch an On-Demand Dating App Clone for Instant Matchmaking Services

Launch an On-Demand Dating App Clone for Instant Matchmaking Services

201 views3 weeks ago

Launch your on-demand dating app clone and revolutionize matchmaking services. With features like instant swiping, ...[Read more]


Ola Taxi vs. Competitors: A Look at Its Unique Features in Ridesharing

Ola Taxi vs. Competitors: A Look at Its Unique Features in Ridesharing

190 views4 weeks ago

Ola Taxi App offers a range of unique features that set it apart from other ...[Read more]


Create a Reliable Medicine Delivery App for Your Business

Create a Reliable Medicine Delivery App for Your Business

223 views4 weeks ago

We provide the ultimate medicine delivery app solution tailored for your pharma business. Leverage advanced ...[Read more]


On-Demand Massage App: Your Uber for Relaxation

On-Demand Massage App: Your Uber for Relaxation

58 views4 weeks ago

We provide an on-demand Uber for massage app solution with advanced features and functionalities to ...[Read more]


InDriver Clone App: Scalable Ride-Hailing Solution for Entrepreneurs

InDriver Clone App: Scalable Ride-Hailing Solution for Entrepreneurs

57 views4 weeks ago

Launch your ride-hailing business with a fully customizable InDriver clone app. Provide flexible fares and ...[Read more]


10 Best AI Tools to Explore in 2025: Top Alternatives to Crushon AI

10 Best AI Tools to Explore in 2025: Top Alternatives to Crushon AI

60 views1 month ago

Discover the top 10 alternatives to Crushon AI for innovative solutions. Compare features, pricing, and benefits ...[Read more]


Ola Clone App Development: Start Your Own Taxi Service

Ola Clone App Development: Start Your Own Taxi Service

54 views1 month ago

Ola Clone App Development offers a powerful, customizable platform to help you launch your own ...[Read more]


The Future of Cutting-Edge App Development: Key Trends

88 views2 months ago

Cutting-edge app development is at the forefront of innovation, and staying updated with the latest ...[Read more]


Tokenization Platform Development Transforming Assets for a Digital Future

Tokenization Platform Development Transforming Assets for a Digital Future

105 views3 months ago

Looking to unlock the potential of your assets? Hivelance, a leading tokenization platform development company, ...[Read more]


Agen Judi Togel Online Taruhan Angka 4d Terbaik dan Terpercaya

205 views4 months ago

Agen Judi Togel Online Taruhan Angka 4d Terbaik dan Terpercaya DAFTAR KLIK DISINI SEKARANG DAFTAR ...[Read more]


Decoding the Battle between Cloud Transformation and Cloud Migration!

Decoding the Battle between Cloud Transformation and Cloud Migration!

319 views11 months ago

🔍 Eager to unravel the critical differences between Cloud Transformation and Cloud Migration? Dive into the ...[Read more]


Effective strategy for B2B Email Marketing in Dubai

489 views1 year ago

Creating an effective B2B email marketing strategy for Dubai, or any market, requires a ...[Read more]


Benefits of integrating chatgpt in mobile app

523 views2 years ago

You might be looking for a secure and efficient way to automate customer conversations on ...[Read more]


GtkPrintUnixDialog not available on linux?

1.5K views2 years ago

Hi I'm trying to use gtk on linux (ubuntu 20.04). GtkPrintUnixDialog not available on linux? ...[Read more]


What are the advantages of Python programming?

964 views3 years ago

Benefits of Python Programming: • Python is Embeddable: There are many advantages of Python ...[Read more]


Filechooser Show the files within a certain foder

1.2K views4 years ago

When using Set_Current_Folder I get a window in which the Folder I enter ...[Read more]


OTT App Development Company | OTT Video Delivery Solutions

OTT App Development Company | OTT Video Delivery Solutions

1.9K views4 years ago

At Oodles Technologies, we deliver customer-centric OTT solutions that are unique and add value to ...[Read more]


Custom and Integrated Supply Chain Solutions

1K views4 years ago

I want to set up my software solutions for transportation and logistics management. However, the ...[Read more]