Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
  • Loading branch information
sam-github committed Jan 28, 2019
commit 6f66f3755be4212a5c64d3b13964cc0f3571f7b4
3 changes: 1 addition & 2 deletions src/tls_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ void TLSWrap::InitSSL() {
SSL_set_verify(ssl_.get(), SSL_VERIFY_NONE, crypto::VerifyCallback);

#ifdef SSL_MODE_RELEASE_BUFFERS
long mode = SSL_get_mode(ssl_.get()); // NOLINT(runtime/int)
SSL_set_mode(ssl_.get(), mode | SSL_MODE_RELEASE_BUFFERS);
SSL_set_mode(ssl_.get(), SSL_MODE_RELEASE_BUFFERS);
#endif // SSL_MODE_RELEASE_BUFFERS

SSL_set_app_data(ssl_.get(), this);
Expand Down