Unfortunately all Safari tells you is "Safari can't open the page https://XXXX because Safari can't establish a secure connection to the server XXXX". As far as error messages go, it's not very useful. Also, there are no options to continue to the page anyway.
There are two easy ways to get past this error however.
1. Use Safari's "Private Window" to open the page you want.
This approach is ok for a quick one-off event, but doesn't provide a long-term solution. This is because Safari will not keep settings for any actions performed within the private window.
When opening the site you want to visit in a private window, you will be presented with a warning saying "This Connection Is Not Private". Click the "Show Details" button.
You will be warned that the certificate is not valid, but you are also given a chance to visit this website anyway. Click that. You'll be prompted for your password and then Safari will open the website.
2. Clear the HSTS cache
A more permanent solution is to clear the HSTS cache. This is done by running the following commands via the Terminal app...
After running these, you will need to restart Safari. Then, when visiting your site, you will be prompted with the same warnings that are shown in a private window, except this time when you enter your password, Safari will save these settings.