Skip to content

Instantly share code, notes, and snippets.

@indutny

indutny/1.patch Secret

Created July 20, 2012 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save indutny/b76871e86a08726c2ecc to your computer and use it in GitHub Desktop.
Save indutny/b76871e86a08726c2ecc to your computer and use it in GitHub Desktop.
commit 5950db197c5ee73922beb67e3b8c060b5fcbc7f7
Author: Fedor Indutny <fedor.indutny@gmail.com>
Date: Fri Jul 20 21:10:23 2012 +0400
tls: revert accidental API change
socket.authorizationError should always be string. Also make sni test
pass.
diff --git a/lib/tls.js b/lib/tls.js
index aec7cae..584ee0a 100644
--- a/lib/tls.js
+++ b/lib/tls.js
@@ -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();
diff --git a/test/simple/test-tls-sni-server-client.js b/test/simple/test-tls-sni-server-client.js
index 721c2c0..093d0fd 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();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment