How to bypass the “Safari can’t establish a secure connection to the server localhost” security…

How to bypass the “Safari can’t establish a secure connection to the server localhost” security restrictionSometimes, even with a valid certificate, your site on a local server can be inaccessible on Safari, especially in developer version following ma…


This content originally appeared on Level Up Coding - Medium and was authored by Louis Brulé Naudet

How to bypass the “Safari can’t establish a secure connection to the server localhost” security restriction

Sometimes, even with a valid certificate, your site on a local server can be inaccessible on Safari, especially in developer version following major updates. This tutorial aims to present a quick and easy solution to bypass this type of restriction by changing the system settings in the Keychain.

Restricting access to the local server is part of the security policy implemented by Apple to prevent malicious code from infiltrating the system. This protection is fundamental and should not be disabled in a global way but should be treated individually depending on the certificate affecting the local server.

Photo by Alexander Shatov on Unsplash

However, a major update of Safari may challenge the validation of the certificate by the browser and will be problematic for the developers as it will be an unnecessary waste of time to solve the problem.

Safari can’t open the Page (localhost).

To do this, the first step is to open the keychain and locate the certificate associated with the local server in the “System” submenu and the “all-items” category :

Localhost certificate location into the Keychain.

Once the certificate is identified and after a double click on its line, it will be necessary to select the “Always trust” option for the “When using this certificate” selection :

“Always trust” option for the “When using this certificate” selection.

Once the change has been made, MacOS will ask for a password to confirm the change due to the sensitivity of the setting to the security policy. After this validation, it will be enough to refresh the page concerned on the web browser to see that the changes have been taken into account. In case of non-renewal of the certificate, this setting should be permanent and persist through the updates of your version of Safari.

Localhost now available on Safari.

However, it should be kept in mind that this setting may pose a risk to your system if implemented across the board on all registered certificates and should only be applied to the local server in a restricted development activity.

Thanks for reading,

Louis Brulé Naudet,

Louis Brulé Naudet


How to bypass the “Safari can’t establish a secure connection to the server localhost” security… was originally published in Level Up Coding on Medium, where people are continuing the conversation by highlighting and responding to this story.


This content originally appeared on Level Up Coding - Medium and was authored by Louis Brulé Naudet


Print Share Comment Cite Upload Translate Updates
APA

Louis Brulé Naudet | Sciencx (2022-11-15T03:27:56+00:00) How to bypass the “Safari can’t establish a secure connection to the server localhost” security…. Retrieved from https://www.scien.cx/2022/11/15/how-to-bypass-the-safari-cant-establish-a-secure-connection-to-the-server-localhost-security/

MLA
" » How to bypass the “Safari can’t establish a secure connection to the server localhost” security…." Louis Brulé Naudet | Sciencx - Tuesday November 15, 2022, https://www.scien.cx/2022/11/15/how-to-bypass-the-safari-cant-establish-a-secure-connection-to-the-server-localhost-security/
HARVARD
Louis Brulé Naudet | Sciencx Tuesday November 15, 2022 » How to bypass the “Safari can’t establish a secure connection to the server localhost” security…., viewed ,<https://www.scien.cx/2022/11/15/how-to-bypass-the-safari-cant-establish-a-secure-connection-to-the-server-localhost-security/>
VANCOUVER
Louis Brulé Naudet | Sciencx - » How to bypass the “Safari can’t establish a secure connection to the server localhost” security…. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/11/15/how-to-bypass-the-safari-cant-establish-a-secure-connection-to-the-server-localhost-security/
CHICAGO
" » How to bypass the “Safari can’t establish a secure connection to the server localhost” security…." Louis Brulé Naudet | Sciencx - Accessed . https://www.scien.cx/2022/11/15/how-to-bypass-the-safari-cant-establish-a-secure-connection-to-the-server-localhost-security/
IEEE
" » How to bypass the “Safari can’t establish a secure connection to the server localhost” security…." Louis Brulé Naudet | Sciencx [Online]. Available: https://www.scien.cx/2022/11/15/how-to-bypass-the-safari-cant-establish-a-secure-connection-to-the-server-localhost-security/. [Accessed: ]
rf:citation
» How to bypass the “Safari can’t establish a secure connection to the server localhost” security… | Louis Brulé Naudet | Sciencx | https://www.scien.cx/2022/11/15/how-to-bypass-the-safari-cant-establish-a-secure-connection-to-the-server-localhost-security/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.