Skip to content

Commit 1ab7c6b

Browse files
committed
crypto: use CHECK instead in getSSLCiphers
The previous throws should never happen, and if they do, they signal a larger issue in core. Make these checks rather than throws.
1 parent 76b8803 commit 1ab7c6b

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/node_crypto.cc

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5618,15 +5618,10 @@ void GetSSLCiphers(const FunctionCallbackInfo<Value>& args) {
56185618
Environment* env = Environment::GetCurrent(args);
56195619

56205620
SSL_CTX* ctx = SSL_CTX_new(TLSv1_server_method());
5621-
if (ctx == nullptr) {
5622-
return env->ThrowError("SSL_CTX_new() failed.");
5623-
}
5621+
CHECK_NE(ctx, nullptr);
56245622

56255623
SSL* ssl = SSL_new(ctx);
5626-
if (ssl == nullptr) {
5627-
SSL_CTX_free(ctx);
5628-
return env->ThrowError("SSL_new() failed.");
5629-
}
5624+
CHECK_NE(ssl, nullptr);
56305625

56315626
Local<Array> arr = Array::New(env->isolate());
56325627
STACK_OF(SSL_CIPHER)* ciphers = SSL_get_ciphers(ssl);

0 commit comments

Comments
 (0)