net: Add option to temporarily accept certs that failed the handshake.

This commit is contained in:
Josh Matthews 2020-05-29 13:35:43 -04:00
parent 433c154595
commit 6a6662195e
8 changed files with 73 additions and 13 deletions

View file

@ -4,6 +4,25 @@
</head>
<body>
<p>${reason}</p>
<pre>${bytes}</pre>
<pre id="bytes">${bytes}</pre>
<button id="leave" onclick="history.back()">Go back (recommended)</button>
<button id="allow">Allow certificate temporarily</button>
<script>
let bytes = document.getElementById('bytes').textContent;
let button = document.getElementById('allow');
let exitButton = document.getElementById('leave');
if (bytes.length) {
button.onclick = function() {
let xhr = new XMLHttpRequest();
xhr.open('GET', 'chrome:allowcert?secret=${secret}&bytes=' + btoa(bytes));
xhr.onloadend = function() {
location.reload(true);
};
xhr.send();
};
} else {
button.style.display = "none";
}
</script>
</body>
</html>

View file

@ -1,3 +1,7 @@
button {
cursor: default;
}
button,
input {
background: white;