Skip to content

Commit 6f0740e

Browse files
committed
crypto: check for SSL_COMP_get_compression_methods()
Function was named SSL_COMP_get_compression_method() (singular) in OpenSSL 0.9.7 and older. Fixes nodejs#1242.
1 parent 0599cb7 commit 6f0740e

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

src/node_crypto.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3638,9 +3638,14 @@ void InitCrypto(Handle<Object> target) {
36383638
ERR_load_crypto_strings();
36393639

36403640
// Turn off compression. Saves memory - do it in userland.
3641-
#ifdef SSL_COMP_get_compression_methods
3642-
// Before OpenSSL 0.9.8 this was not possible.
3643-
STACK_OF(SSL_COMP)* comp_methods = SSL_COMP_get_compression_methods();
3641+
#if !defined(OPENSSL_NO_COMP)
3642+
STACK_OF(SSL_COMP)* comp_methods =
3643+
#if OPENSSL_VERSION_NUMBER < 0x00908000L
3644+
SSL_COMP_get_compression_method()
3645+
#else
3646+
SSL_COMP_get_compression_methods()
3647+
#endif
3648+
;
36443649
sk_SSL_COMP_zero(comp_methods);
36453650
assert(sk_SSL_COMP_num(comp_methods) == 0);
36463651
#endif

0 commit comments

Comments
 (0)