How to test HTTPS Websites from Local Host

On This Page What Does it Mean to Test an HTTPS Website from a Local Environment?

May 28, 2026 · 7 min read · Testing Guide

How to test HTTPS Websites from Local Host

HTTPS (Hypertext Transfer Protocol Secure) and SSL (Secure Socket Layer) certifications help you secure your site from threats and enhance credibility.

However, this imply you can not send requests to the host from any rootage unprotected through HTTPS.

This becomes an matter for developers who wish to test the website using the local environment, as the host will reject any development request sent through the local development environment.

Chrome might send an mistake code as given below:

NET: :ERR_CERT_COMMON_NAME_INVALID

This guide furnish some solvent to solve this problem and test an HTTPS site from a local legion.

What Does it Mean to Test an HTTPS Website from a Local Environment?

Testing an HTTPS Website from means to run and test a website on a local machine using HTTPS to play the secure and encrypted link typically used in a product environment. This process ensures the proper functioning of the HTTPS aspects (like SSL/TLS encryption) in a secure environment.

Read More:

How to Test HTTPS Websites from Local Host: Prerequisites

Here is a step-by-step process of how you can prove HTTPS Websites from Local Host:

Providing SSL Certificates to Test HTTPS Website

For HTTPS, an SSL certificate is expect to establish a secure connexion. A self-signed/locally generated certificate might be flag as ‘ non-secure ’ as it is not from a trusted Certificate Authority.

Here OpenSSL will be used to create certificates for your HTTPS websites. Then, your website will be tested from a local legion.

Follow the below steps to generate all the SSL certificates:

Step 1: Rooting SSL Certificate

  • You need to develop a Root Secure Sockets Layer (SSL) credentials, which will be used to ratify certificates create for case-by-case sphere. Now make theRSA-2048 keyand then salve it to rootCA.key.
  • We will now use this rootCA.key file to acquire a Root SSL certificate. Now you will require a pass phrase to use every clip you create a security.
openssl genrsa -des3 -out rootCA.key 2048
  • Use the key you created to yield a new Root SSL certificate and save it torootCA.pem.
  • By nonremittal, the validity of this certificate will be for 1024 day. Change the number of years you want this certificate.
openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.pem

Step 2: Trusting the Rooted SSL Certificate

Before you use the newly created rootage SSL credential, use your system to trust the given certification.

Step 3: Domain SSL Certificate

  • Now you can use your root SSL certificate to issue a certification for your local environment at localhost.
  • Now develop an OpenSSL configuration file named server.csr.cnf to import settings when you are create a certificate rather than entering them on the command line.
[req] default_bits = 2048 prompting = no default_md = sha256 distinguished_name = dn [dn] C=US ST=RandomState L=RandomCity O=RandomOrganization OU=RandomOrganizationUnit emailAddress=hello @ example.com CN = localhost
  • Now yield a v3.ext file to generate X509 v3 certificate. We will now specify the subjectAltName.
authorityKeyIdentifier=keyid, issuer basicConstraints=CA: Mistaken keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment subjectAltName = @ alt_names [alt_names] DNS.1 = localhost
  • Now generate a key for the localhost using the configuration settings present in theserver.csr.cnfwith the key stored in theserver.key.
openssl req -new -sha256 -nodes -out server.csr -newkey rsa:2048 -keyout server.key -config & lt; (cat server.csr.cnf)

Now, a request for signing certificate will be issued via the Root SSL you create for generating the certificate for the local legion. The output file will be a certificate calledserver.crt.

openssl x509 -req -in server.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out server.crt -days 500 -sha256 -extfile v3.ext

Step 4: Using Your SSL Certificate

Place yourserver.crt and server.keyfiles to a location that is approachable in your server and use them when starting your waiter. Use this only for your local environs and not for paroduction.

Starting Development in SSL Mode In Rails

Once you get your certificates with you, you can simply commence the Puma with the next command.

bin/rails s -b `` ssl: //127.0.0.1:3000? key= $ HOME/certs/localhost.key & amp; cert= $ HOME/certs/localhost.crt

Now visit your desired browser with the address,

SUSA automates exploratory testing with persona-driven behavior, catching bugs that scripted automation misses.

NOTE:Your browser might complain as this certificate is self-signed. But do not panic as we are utilize it for the development stage. Add an exception and then take the provided credential. You are all set to test HTTPS website.

Test SSL Connections Using OpenSSL

Testing SSL connections topically isn & # 8217; t just about yield and installing certificates—it ’ s likewise crucial to verify the server & # 8217; s SSL behavior. OpenSSL furnish a simple way to do this via the bid line.

Basic Command

Use the following bidding to connect to your local HTTPS server and inspect its SSL/TLS shape:

openssl s_client -connect localhost:3000

This initiates a TLS handshake with your waiter and print detail information about:

  • The certificate chain
  • Selected zilch suite
  • TLS protocol version
  • Certificate validity and subject

Read More:

Mutual SSL Debugging Scenarios Using OpenSSL

Here are some mutual SSL debugging scenario using OpenSSL:

1. Check for Hostname Mismatch

If you & # 8217; re prove on localhost, ensure the certificate was issued for localhost and include it in the subjectAltName.

Use:

openssl s_client -connect localhost:3000 -servername localhost

Look for errors like:

verify fault: num=62: Hostname mismatch

2. Verify Certificate Trust

If you & # 8217; re using a self-signed certificate or a custom root CA, you need to explicitly recite OpenSSL to trust it:

openssl s_client -connect localhost:3000 -CAfile rootCA.pem

This forbid trust-related error like:

verify error: num=20: unable to get local issuer credential

3. Inspect Full Certificate Chain

To view the entire certificate concatenation served by the server, use:

openssl s_client -connect localhost:3000 -showcerts

Check that:

  • The full chain is present
  • Each certificate is valid and in the right order

Like what you are read?

You can start discussing with our discordance community

Testing HTTPS Websites On Local Machine

You can perpetually test your HTTPS websites with a local connection option behind the firewall. You may besides choose to access web pages that are preserve on your local machine. In a few moments, you can prove your internal site via the undermentioned methods:

Website Functionality Testing

Website checks whether the website is functioning as per the spec of the requirement.

Read More:

Link Testing

While link examination, you should check for:

  • Outbound links and inbound links
  • Admin e-mail links
  • Presence of any broken tie-in

Forms Testing

Forms help to transmit with customers and seizure important datum for lead coevals. They should be checked for:

  • Validity of stimulant information validity
  • Allowed and invalid input values for all data fields
  • Malfunctioning of forms

Cookies testing

Cookies are small temporary files stored on the exploiter ’ s computer after visit a web page. help in faster loading of web pages.

  • Site testing with enable and disabled cookies
  • Verify the biscuit encryption
  • Security after cookie remotion

HTML/CSS establishment

It tests the code of the site for:

  • HTML mistake in syntax
  • Site crawling enable for search locomotive
  • Accuracy of site map in both XML and HTML formatting
  • Also ensure to the website site on all browsers – Mozilla Firefox, Microsoft Edge, Safari, Google Chrome and many others.
  • You should too check the site at resolution like 1024 x 768, 1280 x 1024.
  • Additionally check the website when logged in by admin user or subscribers.

Read More:

How Does BrowserStack Help test HTTPS Websites from Local Host

Using enables your devs to run automated tests on your internal dev environments, on localhost, staging setup, or from behind a corporate firewall.

It establishes a secure connection between your machine and the. After you set up Local examination, all your individual URLs are mechanically resolved, include HTTPS URLs and early URLs host behind a proxy or firewall.

Talk to an Expert

Conclusion

Now that you feature a clear idea of how to test HTTPS website and also generating SSL credential for your website for localhost, you can progress a racy website with all the exam performed from the internal environs and deliver a better user experience.

Don ’ t forget to use to test websites hosted on localhost or in represent environments while running tests on an.

With BrowserStack Local Testing, you can:

  • Test websites and apps hosted on internal servers
  • Create a untroubled burrow between your local dev/staging environment and the BrowserStack Cloud
  • Use language bindings to trigger build verification examination at every compile
  • Use multiple binary instances to test different lineament branches—at the same time
Tags
28,000+ Views

# Ask-and-Contributeabout this issue with our Discord community.

Related Guides

Automate This With SUSA

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.

Try SUSA Free

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free