diff --git a/lib/tls.js b/lib/tls.js index 4e427fefa8..d437da9a29 100644 --- a/lib/tls.js +++ b/lib/tls.js @@ -1089,7 +1089,7 @@ function Server(/* [options], listener */) { } else { var verifyError = pair.ssl.verifyError(); if (verifyError) { - pair.cleartext.authorizationError = verifyError; + pair.cleartext.authorizationError = verifyError.message; if (self.rejectUnauthorized) { socket.destroy(); diff --git a/test/simple/test-tls-sni-server-client.js b/test/simple/test-tls-sni-server-client.js index 721c2c0241..093d0fd115 100644 --- a/test/simple/test-tls-sni-server-client.js +++ b/test/simple/test-tls-sni-server-client.js @@ -94,7 +94,9 @@ server.listen(serverPort, startTest); function startTest() { function connectClient(options, callback) { var client = tls.connect(options, function() { - clientResults.push(client.authorized); + clientResults.push( + client.authorizationError && + /Hostname\/IP doesn't/.test(client.authorizationError)); client.destroy(); callback();