Is there a way to detect in JavaScript if the site was loaded over HTTPS using an SSL certificate untrusted by the browser (but accepted by the user)? I.e. it is invalid/expired/self-signed SSL certificate.
window.isSecureContext
does not indicate this, it is true
in all cases I tried on my own and on badssl.com if the page is loaded over HTTPS.
My use case: I am trying to use ApplicationCache but it refuses to work: on Chrome it fires the error
callback with exception message "Manifest fetch failed (9)", on Firefox it fails silently.
As this means the browser behaves differently I hope it is detectable and I would like to make sure ApplicationCache is skipped altogether when it cannot be used.
I'd not like to create a seperate SSL connection from a JavaScript (user might have certs of custom CAs installed, etc.), nor try-catch an exception with ApplicationCache.