Skip to content

Commit 6f66f37

Browse files
committed
src: remove unnecessary call to SSL_get_mode
SSL_set_mode() bit-ORs its argument into the current mode, its not necessary for to do it ourself (though it doesn't cause harm). See: - https://www.openssl.org/docs/man1.1.0/ssl/SSL_set_mode.html - https://github.com/nodejs/node/blob/0ce615c4af/deps/openssl/openssl/ssl/ssl_lib.c#L2176-L2177
1 parent 4814987 commit 6f66f37

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/tls_wrap.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ void TLSWrap::InitSSL() {
111111
SSL_set_verify(ssl_.get(), SSL_VERIFY_NONE, crypto::VerifyCallback);
112112

113113
#ifdef SSL_MODE_RELEASE_BUFFERS
114-
long mode = SSL_get_mode(ssl_.get()); // NOLINT(runtime/int)
115-
SSL_set_mode(ssl_.get(), mode | SSL_MODE_RELEASE_BUFFERS);
114+
SSL_set_mode(ssl_.get(), SSL_MODE_RELEASE_BUFFERS);
116115
#endif // SSL_MODE_RELEASE_BUFFERS
117116

118117
SSL_set_app_data(ssl_.get(), this);

0 commit comments

Comments
 (0)