Product Documentation

Knowledgebase

Previous Topic

Next Topic

Google Chrome Tips for Developers

Chrome appears to have fixed the problems documented below, but if you are having trouble connecting to an application server that you are running locally on your computer, the solutions below may be helpful.

Tip: If the domain name localhost is not working, use the IP Address 127.0.0.1

Tip: If you have problems with getting Windows to connect to the proper domain (including localhost), this document from Microsoft explains how Windows works with DNS: Disable DNS client-side caching on DNS clients.

Configuring Chrome for Localhost Connections

The following information is not useful for users who only browse the web. It is for those running and testing local application servers, such as the FairCom Database.

It is common for developers, QA engineers, and testers to test new applications on their laptop by running a local web application server without a valid certificate. It is too time consuming and expensive to generate local certificates.

The new security settings in the Google Chrome Web Browser prevent users from using HTTP (where a certificate is not required), and it prevents the HTTPS protocol from connecting to application servers that do not have a valid certificate. Because Google combined these new behaviors, users cannot open locally-run applications in Google Chrome.

The sections below show how to configure Google Chrome for running local applications.

Use 127.0.0.1 Instead of Localhost

Tip: If the localhost domain name is not working, use the IP Address 127.0.0.1

To test FairCom Database Web Tools, use http://127.0.0.1:8080/ or https://127.0.0.1:8443/ instead of http://localhost:8080/ or https://localhost:8443/.

It is a best practice to use 127.0.0.1 instead of localhost to ensure you connect to your local computer. This is because localhost does not work reliably in some languages, such as Python. Also your computer’s hosts file and/or DNS settings may be configured to redirect the localhost domain name to another computer besides your local computer.

If you use 127.0.0.1, you don’t have to worry about the behavior of localhost and the hosts file.

If you want to verify how your hosts file modifies the behavior of localhost, you can open it in any editor to see what IP address it maps to localhost.

In Windows, the hosts file is located in C:\Windows\System32\drivers\etc. By default, it uses DNS to map localhost. Your DNS server typically maps localhost to 127.0.0.1, but it can map it anywhere and this can cause problems.

In Linux, the hosts file is located in the /etc folder. By default, Linux maps localhost to 127.0.0.1

HTTP

How to enable HTTP on Google Chrome Web Browser

This section shows you how to connect to connect to FairCom’s database browser-based tools over HTTP using: http://127.0.0.1:8080/ when the database is running on your local computer.

As of 2020, Google Chrome Web Browser automatically redirects all HTTP URLs to HTTPS. This is a great security feature called HSTS, but it causes trouble for developers, QA engineers, and testers who are testing the user interface of application servers running on their local computers.

You can stop Google Chrome from automatically redirecting HTTP URLs to HTTPS for localhost by doing the following:

Put the following URL in the Chrome Browser:

chrome://net-internals/#hsts

In the textbox under the section, [Delete domain security policies],

type localhost and push the [Delete] button

This only changes the setting for the localhost domain. It does not compromise security for other domains.

HTTPS

How to enable HTTPS on Google Chrome Web Browser when the local app server does not have a valid certificate

This section shows you how to connect to connect to FairCom’s database browser-based tools over HTTPS using: https://127.0.0.1:8443/ when the database is running on your local computer.

As of 2020, Google Chrome Web Browser prevents users from going to a website that has an invalid certificate. This is a great security feature, but it causes trouble for developers, QA engineers, and testers who are testing web applications served from their local computers.

You can configure Google Chrome to revert to its original behavior of displaying a warning page when you go to a website that has an invalid certificate. On the warning page, you can choose the Advanced Options and go to the site, or you can choose not to go to the site.

To configure Chrome to use this approach, you can do the following.

Put the following URL in the Chrome Browser: chrome://flags/#allow-insecure-localhost

In the section, [Allow invalid certificates for resources loaded from localhost.]

Select [Enabled] from the dropdown

When you go to a site that has an invalid certificate, Google Chrome will display “Not secure” next to the URL, as shown below. If you hover over the “Not Secure” icon, it notifies you that the certificate is invalid. This is expected because the FairCom Database cannot ship with a certificate that works with your local computer.

It is safe to connect locally to a FairCom database without a valid certificate. In a production environment, our default certificate must be replaced with a valid certificate if applications and users are allowed to connect from other computers.

TOCIndex