Skip to content

Instantly share code, notes, and snippets.

@NamPNQ
Last active October 14, 2016 05:14
Show Gist options
  • Save NamPNQ/e85d764309c3c6fe5abe254c8cd94fb6 to your computer and use it in GitHub Desktop.
Save NamPNQ/e85d764309c3c6fe5abe254c8cd94fb6 to your computer and use it in GitHub Desktop.
Check ssl cert trusted
//Source: http://stackoverflow.com/a/25077676/1798281
<script> var sslCertTrusted = false; </script>
<script src="https://example.com/ssltest.js"></script>
<script>
if (!sslCertTrusted)
{
alert('Sorry, you need to install the certificate first.');
window.location('http://example.com/cert_install_instructions/');
}
else
{
// alert('Redirecting to secure connection')
window.location('https://example.com/');
}
<script>
sslCertTrusted = true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment