Skip to content

Instantly share code, notes, and snippets.

@wmakley
Last active January 12, 2016 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wmakley/ed50dc17feecefe0e7ac to your computer and use it in GitHub Desktop.
Save wmakley/ed50dc17feecefe0e7ac to your computer and use it in GitHub Desktop.
<script>
// simple jQuery version. change variables to customize.
window.parseTLSinfo = function(data) {
var alert_classes = 'ssl-notice alert';
var prepend_to = 'body';
var tls_version = parseFloat(data.tls_version.split(/\s+/)[1]);
if (isNaN(tls_version)) { throw "couldn't parse TLS version from input: " + data.tls_version; }
if (tls_version < 1.1) {
var notice = jQuery("<div class='" + alert_classes + "'>" +
"<p>Your browser will be unable to access this site after June 30, 2016" +
" because it does not support modern encryption technology. Before that" +
" happens, please <a href='https://whatbrowser.org' target='_blank'>upgrade</a> as soon as possible.</p>" +
"<p>If you are running Windows XP or Vista, please install" +
" <a href='https://www.google.com/chrome/browser/desktop/' target='_blank'>Google Chrome</a>" +
" or <a href='https://www.mozilla.org/en-US/firefox/new/' target='_blank'>Mozilla Firefox</a>," +
" as Microsoft is not updating Internet Explorer on these operating systems.</p>" +
"</div>"
);
jQuery(prepend_to).prepend(notice);
}
};
</script>
<script src="https://www.howsmyssl.com/a/check?callback=parseTLSinfo"></script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment