Skip to content

Commit bd9c20b

Browse files
committed
clean-up verify - TLS to moddable.com works again
1 parent 27a25f2 commit bd9c20b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

modules/crypt/ssl/ssl_cert.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ class CertificateManager {
121121
validity = X509.decodeTBS(x509.tbs).validity;
122122
if (!((validity.from < now) && (now < validity.to))) {
123123
trace("date validation failed on received certificate\n");
124-
return false;
124+
continue;
125125
}
126126

127127
if (!this._verify(X509.decodeSPKI(certs[i + 1]), x509))
128-
return false;
128+
continue;
129129
x509 = undefined;
130130

131131
let aki = X509.decodeAKI(certs[i + 1]);
@@ -148,8 +148,10 @@ class CertificateManager {
148148

149149
x509 = X509.decode(certs[length]);
150150
validity = X509.decodeTBS(x509.tbs).validity;
151-
if (!((validity.from < now) && (now < validity.to)))
152-
throw new Error("date validation failed");
151+
if (!((validity.from < now) && (now < validity.to))) {
152+
trace("date validation failed\n");
153+
return false;
154+
}
153155

154156
spki = this.findCert("ca.ski", X509.decodeAKI(certs[length]));
155157
if (spki && this._verify(spki, x509))

0 commit comments

Comments
 (0)