Log failed cert validations
This commit is contained in:
parent
aab6cc4370
commit
81fa8bbe72
|
@ -83,7 +83,9 @@ async function loadPDF(signedPdfBuffer : ArrayBuffer): Promise<any> {
|
|||
'8h9+TbL3ACHDqA4fi5sAbZ7nMXp8RK4o5A==\r\n'+
|
||||
'-----END CERTIFICATE-----';
|
||||
|
||||
const issuedpemCertificate = ( result.pemCertificate.trim() == refcert.trim());
|
||||
const pdfCert = result.pemCertificate.trim();
|
||||
const pdfOrg = result.issuedBy.organizationName;
|
||||
const issuedpemCertificate = (pdfCert == refcert.trim());
|
||||
|
||||
//console.log(`pdf is signed by this cert ${result.pemCertificate.trim()}`);
|
||||
//console.log(issuedpemCertificate);
|
||||
|
@ -98,6 +100,13 @@ async function loadPDF(signedPdfBuffer : ArrayBuffer): Promise<any> {
|
|||
return Promise.resolve(receipt);
|
||||
|
||||
} else {
|
||||
// According to the Sentry docs, this can be up to 8KB in size
|
||||
// https://develop.sentry.dev/sdk/data-handling/#variable-size
|
||||
Sentry.setContext("certificate", {
|
||||
pdfCert: pdfCert,
|
||||
pdfOrg: pdfOrg,
|
||||
});
|
||||
Sentry.captureMessage('Certificate validation failed');
|
||||
console.error('invalid certificate');
|
||||
return Promise.reject(`invalid certificate + ${JSON.stringify(result)}`);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue