-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
439 lines (375 loc) · 17.5 KB
/
Copy pathindex.html
File metadata and controls
439 lines (375 loc) · 17.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
<!DOCTYPE html>
<title>Quick Chain Check - Powered by Certify The Web</title>
<style>
*,
body {
font-family: Arial, Helvetica, sans-serif;
}
body {
font-size: 10pt;
padding: 2em;
max-width: 800px;
color: #383838;
}
.logo {
float: left;
margin-top: 0.6em;
padding-right: 1em;
height: 32px;
}
.progress-indicator {
/*https://github.com/SamHerbert/SVG-Loaders/edit/master/svg-loaders/rings.svg*/
background-image: url("data:image/svg+xml,%3C!-- By Sam Herbert (@sherb), for everyone. More @ http://goo.gl/7AJzbL --%3E%3Csvg width='45' height='45' viewBox='0 0 45 45' xmlns='http://www.w3.org/2000/svg' stroke='%23fff'%3E%3Cg fill='none' fill-rule='evenodd' transform='translate(1 1)' stroke-width='2'%3E%3Ccircle cx='22' cy='22' r='6' stroke-opacity='0'%3E%3Canimate attributeName='r' begin='1.5s' dur='3s' values='6;22' calcMode='linear' repeatCount='indefinite' /%3E%3Canimate attributeName='stroke-opacity' begin='1.5s' dur='3s' values='1;0' calcMode='linear' repeatCount='indefinite' /%3E%3Canimate attributeName='stroke-width' begin='1.5s' dur='3s' values='2;0' calcMode='linear' repeatCount='indefinite' /%3E%3C/circle%3E%3Ccircle cx='22' cy='22' r='6' stroke-opacity='0'%3E%3Canimate attributeName='r' begin='3s' dur='3s' values='6;22' calcMode='linear' repeatCount='indefinite' /%3E%3Canimate attributeName='stroke-opacity' begin='3s' dur='3s' values='1;0' calcMode='linear' repeatCount='indefinite' /%3E%3Canimate attributeName='stroke-width' begin='3s' dur='3s' values='2;0' calcMode='linear' repeatCount='indefinite' /%3E%3C/circle%3E%3Ccircle cx='22' cy='22' r='8'%3E%3Canimate attributeName='r' begin='0s' dur='1.5s' values='6;1;2;3;4;5;6' calcMode='linear' repeatCount='indefinite' /%3E%3C/circle%3E%3C/g%3E%3C/svg%3E");
color: whitesmoke;
background-repeat: no-repeat;
height: 64px;
width: 64px;
background-color: #000;
margin-top: 1em;
padding-left: 4em;
padding-top: 1em;
filter: invert();
}
table {
border: 1px solid gainsboro;
border-collapse: collapse;
min-width: 800px;
}
td {
border: 1px solid gainsboro;
padding: 4px;
}
.tagline {
font-size: 8pt;
margin-left: 16em;
margin-top: 0;
}
.tagline,
.tagline a {
color: rgb(116, 116, 116);
}
h1,
h2,
h3,
h3 {
margin-bottom: 0;
margin-top: 0.3em;
font-weight: 200;
white-space: normal;
}
.error-notice,
.legacy-notice,
.modern-notice,
.success-notice,
.warning-notice {
padding: 0.8em;
overflow: auto;
margin-top: 1em;
margin-bottom: 1em;
}
.error-notice p,
.legacy-notice p,
.modern-notice p,
.warning-notice p {
margin: 0;
white-space: normal;
}
.warning-notice {
background-color: #ffb963;
color: #380000;
font-weight: bold;
}
.error-notice {
background-color: #ffe2e2;
color: #980000;
}
.legacy-notice {
background-color: #ffb55c;
color: #380000;
font-weight: bold;
}
.modern-notice {
background-color: #ffe5b6;
color: #313131;
}
.success {
color: darkgreen;
}
.warning {
color: darkorange;
font-weight: bold;
}
.error {
color: darkred;
font-weight: bold;
}
hr {
border-top: 1px solid rgb(212 212 212);
margin-top: 1em;
}
.chain-summary {
font-weight: 600;
border: 1px solid #e4e4e4;
padding: 1em;
background-color: #f7f7f7;
white-space: normal;
}
.chain-item {
font-size: 8pt;
border: 1px solid #e4e4e4;
padding: 1em;
background-color: #fbfbfb;
margin-bottom: 1em;
box-shadow: 1px 2px 8px 0 #dcdcdc;
}
.chain-item label {
font-weight: 600;
min-width: 64px;
display: inline-block;
}
</style>
<body onload="startup()">
<img src="https://certifytheweb.com/images/icon.png" class="logo"/>
<h1> Quick Chain Checker</h1>
<h4 class="tagline">Powered by <a href="https://certifytheweb.com">Certify The Web</a>
</h4>
<p>Your web server certificate chain affects how trusted your website certificate is by browsers and devices. To perform a quick check of your servers certificate chain, enter your domain:</p>
<input type="text" id="domain" placeholder="Your domain e.g. example.com, without http:// or https:// prefix">
<button onclick="checkChain()">Check Chain</button>
<hr/>
<div id="progress" class="progress-indicator" style="display:none;">Scanning..</div>
<pre id="results"></pre>
<pre id="results-json" style="display: none;"></pre>
<p style="margin-top:4em;">
<small>
<strong>Note: This tool will only show your current chain as our client code sees it and applies some ACME CA (Let's Encrypt etc) related checks. It will not validate your entire chain and will assume clients know commonly trusted root certificates. For alternative full chain checking tools (including missing intermediates), see <a href="https://docs.certifytheweb.com/docs/kb/kb-202109-letsencrypt#chain-checking" target="_blank">https://docs.certifytheweb.com/docs/kb/kb-202109-letsencrypt#chain-checking</a>
</strong>
</small>
</p>
<p>
<small>This optimistically named tool is sponsored by Certify The Web - ACME Certificate Management UI. <a href="https://certifytheweb.com" target="_blank">certifytheweb.com</a>
</small>
</p>
<script>
var warningCerts = [
{
serial: "400175048314A4C8218C84A90C16CDDF",
name: "R3 cross-signed by IdenTrust",
description: "This certificate must not be present in your chain. Immediate action is required. See https://docs.certifytheweb.com/docs/kb/kb-202109-letsencrypt/"
}
];
var chainClassifications = [
{
name: "Let's Encrypt Legacy Chain (Supports older devices)",
description: "This Let's Encrypt chain includes the expired DST Root CA X3 in order to remain compatible with older operating system such as Android 7.0 and lower.",
serials: ["44AFB080D6A327BA893039862EF8406B"],
status: "OK:Legacy"
}, {
name: "Let's Encrypt Legacy Chain (Supports older devices)",
description: "This Let's Encrypt chain includes the expired DST Root CA X3 in order to remain compatible with older operating system such as Android 7.0 and lower.",
serials: ["4001772137D4E942B8EE76AA3C640AB7"],
status: "OK:Legacy"
}, {
name: "Let's Encrypt Modern Chain (May not support some older devices)",
description: "This Let's Encrypt chain uses the newer ISRG Root X1 root, which is trusted by current operating systems. This chain may cause issues for some old devices, particularly Android 7.1 and lower.",
serials: ["008210CFB0D240E3594463E0BB63828B00"],
status: "OK:Modern"
}, {
name: "Let's Encrypt Modern Chain (May not support some older devices)",
description: "This Let's Encrypt chain uses the newer ISRG Root X1 root, which is trusted by current operating systems. This chain may cause issues for some old devices, particularly Android 7.1 and lower.",
serials: ["00912B084ACF0C18A753F6D62E25A75F5A"],
status: "OK:Modern"
}, {
name: "Let's Encrypt E1 > ISRG Root X2 (ECDSA) Short Chain (May not support some older devices)",
description: "This Let's Encrypt chain uses the newer ISRG Root X2 root, which is trusted by many current operating systems, but not all. This chain may cause issues for some old devices.",
serials: [
"00B3BDDFF8A7845BBCE903A04135B34A45", "41D29DD172EAEEA780C12C6CE92F8752"
],
status: "OK:ECDSA"
}, {
name: "Let's Encrypt (ECDSA) Long Chain (May not support some older devices)",
description: "This Let's Encrypt chain uses the newer ISRG Root X1 root, which is trusted by current operating systems. This chain may cause issues for some old devices.",
serials: [
"079E492886376FD40848C23FC631E463", "008210CFB0D240E3594463E0BB63828B00"
],
status: "OK:ECDSA"
}, {
name: "Let's Encrypt Mixed Chain (Out of order)",
description: "This chain has been incorrectly resolved. Consider settings ISRG Root X1 as your preferred issuer in your ACME client to resolve chain ambiguity.",
serials: [
"4001772137D4E942B8EE76AA3C640AB7", "912B084ACF0C18A753F6D62E25A75F5A"
],
status: "Error"
}
];
function checkDomain(domain, showResults) {
fetch('https://chaincheckergo.azurewebsites.net/api/checkchain?name=' + domain)
.then(response => response.json())
.then((data) => {
hideProgress();
var json = JSON.stringify(data, null, 2);
if (showResults) {
document
.getElementById("results-json")
.innerText = json;
formatResults(data);
}
});
}
function diagnoseChain(result) {
var diagnosis = {
title: "Summary",
summary: "Certificate Chain OK",
status: "OK",
hasExpiredItems: false,
hasLegacyCompat: false
};
if (result.chainItems.length == 0) {
diagnosis.summary = "No certificate chain to diagnose";
diagnosis.status = "Error"
}
if (result.chainItems[0].status == "Expired") {
diagnosis.title = "Certificate has expired";
diagnosis.summary = "This certificate has expired and should be renewed.";
diagnosis.status = "Error"
}
if (result.chainItems[0].status == "Expiring") {
diagnosis.title = "Certificate will expire soon";
diagnosis.summary = "This certificate will expires soon and should be renewed.";
diagnosis.status = "Warning"
}
for (var w of warningCerts) {
if (result.chainItems.find(c => c.serial == w.serial)) {
diagnosis.title = "Action Required";
diagnosis.summary = w.name + ": " + w.description;
diagnosis.hasExpiredItems = true;
diagnosis.status = "Error";
}
}
for (var classification of chainClassifications) {
var matched = false;
if (result.chainItems.length >= 2) {
if (classification.serials[classification.serials.length - 1].toUpperCase().endsWith(result.chainItems[result.chainItems.length - 1].serial.toUpperCase())) {
if (classification.serials.length == 1) {
matched = true;
}
if (!matched && classification.serials.length > 1) {
if (classification.serials[classification.serials.length - 2].toUpperCase().endsWith(result.chainItems[result.chainItems.length - 2].serial.toUpperCase())) {
matched = true;
}
}
// chain match
if (matched && diagnosis.status == "OK") {
diagnosis.title = classification.name;
diagnosis.status = classification.status;
diagnosis.summary = classification.description
} else if (matched && classification.status.startsWith("Error")) {
diagnosis.title = classification.name;
diagnosis.status = classification.status;
diagnosis.summary = classification.description
}
}
}
}
return diagnosis;
}
function formatResults(result) {
if (result.chainItems.length == 0) {
document
.getElementById("results")
.innerHTML = "<div class='error-notice'><p>" + result.summary + "</p></div>";
return;
} else {
var chainSummary = result
.chainItems
.map(c => c.name)
.join(" ▶▶ ");
if (result.chainItems.length > 1) {
var lastItem = result.chainItems[result.chainItems.length - 1];
if (lastItem.issuer != lastItem.name) {
chainSummary += " ▶▶ [" + lastItem.issuer + "]"
}
}
result.summary = chainSummary;
}
var diagnostic = "";
var diagnosis = diagnoseChain(result);
if (diagnosis.status == "OK") {
diagnostic = "<div class='success-notice'>" + diagnosis.summary + "</div>";
} else {
if (diagnosis.status == "Error") {
diagnostic = "<div class='error-notice'><h3>" + diagnosis.title + "</h3> <p>" + diagnosis.summary + "</p></div>";
}
if (diagnosis.status == "Warning") {
diagnostic = "<div class='warning-notice'><h3>" + diagnosis.title + "</h3> <p>" + diagnosis.summary + "</p></div>";
}
if (diagnosis.status == "OK:Legacy") {
diagnostic = "<div class='legacy-notice'><h3>" + diagnosis.title + "</h3> <p>" + diagnosis.summary + "</p></div>";
}
if (diagnosis.status == "OK:Modern") {
diagnostic = "<div class='modern-notice'><h3>" + diagnosis.title + "</h3> <p>" + diagnosis.summary + "</p></div>";
}
if (diagnosis.status == "OK:ECDSA") {
diagnostic = "<div class='modern-notice'><h3>" + diagnosis.title + "</h3> <p>" + diagnosis.summary + "</p></div>";
}
}
var output = "<div class='results'>";
output += "<h2>Certificate Chain for " + result.domain + "</h2>";
output += "<p class='chain-summary'>" + result.summary + "</p>";
output += diagnostic;
for (var i of result.chainItems) {
output += "<div class='chain-item'>";
output += "<h2>" + i.name + "</h2>";
output += "<p><label>Serial</label> " + i.serial + "</p>";
output += "<p><label>Issuer</label> " + i.issuer + "</p>";
output += "<p><label>Start</label> " + new Date(i.startDate).toDateString() + "</p>";
output += "<p><label>Expiry</label> " + new Date(i.expiryDate).toDateString() + "</p>";
output += "<p><label>Type</label> " + i.type + "</p>";
output += "<p><label>Status</label> " + (
i.status == "OK"
? "<span class='success'>OK</span>"
: i.status == "Expiring"
? "<span class='warning'>Expiring</span>"
: i.status == "Expired"
? "<span class='error'>Expired</span>"
: i.status) + "</p>";
output += "</div>";
}
document
.getElementById("results")
.innerHTML = output;
}
function showProgress() {
document
.getElementById("progress")
.style
.display = 'block';
}
function hideProgress() {
document
.getElementById("progress")
.style
.display = 'none';
}
function checkChain() {
var domain = document
.getElementById("domain")
.value;
if (!(domain != null && domain.length > 3 && domain.length < 255 && domain.indexOf(".") > -1)) {
alert("Check the domain you have entered is valid.");
return;
}
if (domain.indexOf("http") == -1) {
domain = "https://" + domain;
}
let url = (new URL(domain));
domain = url.hostname;
showProgress();
checkDomain(domain, true);
}
// warmup call for service
function startup() {
checkDomain("cloudflare.com", false);
}
</script>
</body>