Is it possible in JavaScript to check a remote domain for SSL? The use case is, a user visits my site and enters their domain name into a form, and my JavaScript queries their domain to see if it uses SSL then displays an "SSL" if it does.
I am using jQuery (1.8.2) so I try:
$.ajax({
type: 'GET',
url: 'https://the-domain-entered',
crossDomain: true,
})
.done(function(data) {
console.log('success: ' + data);
})
.fail(function(data) {
console.log('fail: ' + data.statusText);
});
This always returns:
fail: error