diff --git a/test/parallel/test-tls-key-mismatch.js b/test/parallel/test-tls-key-mismatch.js index 65cac6f07a296c..93c7e70d8c61f7 100644 --- a/test/parallel/test-tls-key-mismatch.js +++ b/test/parallel/test-tls-key-mismatch.js @@ -8,6 +8,8 @@ if (!common.hasCrypto) { const assert = require('assert'); const tls = require('tls'); const fs = require('fs'); +const errorMessageRegex = new RegExp('^Error: error:0B080074:x509 ' + + 'certificate routines:X509_check_private_key:key values mismatch$'); const options = { key: fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'), @@ -16,4 +18,4 @@ const options = { assert.throws(function() { tls.createSecureContext(options); -}); +}, errorMessageRegex);