Skip to content

Commit

Permalink
crypto: proper fix for d7e700's cause
Browse files Browse the repository at this point in the history
Remove useless tests, and `ERR_peek_error()` calls. Things are being set
in a proper order now and there is no need for hacky extra checks.

The right order was:

1. Set certificate
2. Set key

Because setting certificate doesn't properly handle key mismatch errors.

Fix: node-forward/node#67
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: node-forward/node#68
  • Loading branch information
indutny committed Nov 26, 2014
1 parent ce56dcc commit 0f66835
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 129 deletions.
5 changes: 0 additions & 5 deletions src/node_crypto.cc
Expand Up @@ -508,11 +508,6 @@ int SSL_CTX_use_certificate_chain(SSL_CTX* ctx,

ret = SSL_CTX_use_certificate(ctx, x);

if (ERR_peek_error() != 0) {
// Key/certificate mismatch doesn't imply ret==0 ...
ret = 0;
}

if (ret) {
// If we could set up our certificate, now proceed to
// the CA certificates.
Expand Down
62 changes: 0 additions & 62 deletions test/simple/test-https-invalid-key.js

This file was deleted.

62 changes: 0 additions & 62 deletions test/simple/test-tls-invalid-key.js

This file was deleted.

0 comments on commit 0f66835

Please sign in to comment.