Generating a Self-Signed SSL Certificate for WAMP on Windows 10/11

WAMP self-signed SSL certificate checklist for Windows local development, Apache SSL, trusted certificates, browser testing, and rollback planning

Step 1: Install OpenSSL

  • Download OpenSSL: OpenSSL is a tool used to create SSL certificates. You can download it from OpenSSL’s official website.
  • Install OpenSSL: Run the installer and follow the on-screen instructions. Make sure to add OpenSSL to your system’s PATH during installation.

Step 2: Create a Self-Signed SSL Certificate

  • Open Command Prompt: Press Win + R, type cmd, and hit Enter to open the Command Prompt.
  • Navigate to OpenSSL Bin Directory: Use the cd command to navigate to the OpenSSL ‘bin’ directory. For example:
    cd C:Program FilesOpenSSL-Win64bin
  • Generate Private Key: Run the following command to create a private key:
    openssl genrsa -out localhost.key 2048
  • Generate Certificate Signing Request (CSR): Create a CSR using the private key:
    openssl req -new -key localhost.key -out localhost.csr
    You will be prompted to enter details like country, state, organization, etc. For ‘Common Name’, use ‘localhost’.
  • Generate Self-Signed Certificate: Use the CSR to create a self-signed certificate:
    openssl x509 -req -days 365 -in localhost.csr -signkey localhost.key -out localhost.crt

Step 3: Configuring WAMP to Use the SSL Certificate

  • Copy Certificate Files: Copy the localhost.key and localhost.crt files to the Apache directory in WAMP (e.g., C:wamp64binapacheapache2.4.41conf).
  • Edit Apache Configuration:
    • Open the httpd.conf file located in the Apache directory.
    • Ensure that the SSL module is enabled (remove the # at the start of the line):
      LoadModule ssl_module modules/mod_ssl.so
    • Add the following lines at the end of the file to configure SSL:
      <VirtualHost *:443> DocumentRoot "c:/wamp64/www" ServerName localhost SSLEngine on SSLCertificateFile "conf/localhost.crt" SSLCertificateKeyFile "conf/localhost.key" </VirtualHost>
  • Restart WAMP: Restart WAMP to apply the changes.

Step 4: Accessing Your Site with HTTPS

  • Open Your Browser: Navigate to https://localhost. You might see a security warning because the certificate is self-signed. Proceed to access your site.

Conclusion:

By following these steps, you’ve successfully created a self-signed SSL certificate and configured WAMP to use it. This setup will allow you to run WordPress and other applications over HTTPS on your local Windows machine, providing a more realistic environment for development and testing.

2026 local SSL refresh

A self-signed certificate is useful for local WAMP development, but it is not a production certificate. Use it to test HTTPS-only cookies, mixed-content fixes, redirects, secure admin workflows, and plugin behavior before deploying to a real host with a trusted public certificate.

Before changing Apache config, back up the WAMP virtual host and SSL files, keep private keys out of shared folders, and document how to remove the local trust entry later. After setup, test localhost, the chosen local hostname, browser certificate details, WordPress Site URL settings, and any redirect rules so the local environment does not mask a production HTTPS problem.

Related Fix I.T. Phill reading

Sources

Picture of admin

admin

Leave a Reply

Sign up for our Newsletter

Get the latest information on what is going on in the I.T. World.