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.
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.
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 :
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 :
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.
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,
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
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/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.