Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
tls: revert accidental API change
Browse files Browse the repository at this point in the history
socket.authorizationError should always be string. Also make sni test
pass.
  • Loading branch information
indutny committed Jul 20, 2012
1 parent 4aa09d1 commit 5950db1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/tls.js
Expand Up @@ -1059,7 +1059,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();
Expand Down
4 changes: 3 additions & 1 deletion test/simple/test-tls-sni-server-client.js
Expand Up @@ -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();
Expand Down

0 comments on commit 5950db1

Please sign in to comment.