I can't reproduce on my Ubuntu 14.04 box. Do you use a custom OpenSSL build? If so, could you provide the configure options?
ubuntu@ubuntu1404:~/ruby-2.4.0-preview1$ ./target/bin/ruby -v
ruby 2.4.0preview1 (2016-06-20 trunk 55466) [x86_64-linux]
ubuntu@ubuntu1404:~/ruby-2.4.0-preview1$ ldd ./target/lib/ruby/2.4.0/x86_64-linux/openssl.so
linux-vdso.so.1 => (0x00007ffebc3c8000)
libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007f6f408f3000)
libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f6f40517000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f6f402f8000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6f3ff33000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f6f3fd2f000)
/lib64/ld-linux-x86-64.so.2 (0x00005598adbb4000)
ubuntu@ubuntu1404:~/ruby-2.4.0-preview1$ dpkg -s libssl1.0.0
Package: libssl1.0.0
Status: install ok installed
Priority: important
Section: libs
Installed-Size: 2944
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Architecture: amd64
Multi-Arch: same
Source: openssl
Version: 1.0.1f-1ubuntu2.19
Depends: libc6 (>= 2.14), debconf (>= 0.5) | debconf-2.0
Pre-Depends: multiarch-support
Description: Secure Sockets Layer toolkit - shared libraries
This package is part of the OpenSSL project's implementation of the SSL
and TLS cryptographic protocols for secure communication over the
Internet.
.
It provides the libssl and libcrypto shared libraries.
Original-Maintainer: Debian OpenSSL Team <pkg-openssl-devel@lists.alioth.debian.org>
ubuntu@ubuntu1404:~/ruby-2.4.0-preview1$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.4 LTS
Release: 14.04
Codename: trusty
Maybe this works for you:
--- ext/openssl/ossl_ssl.c.orig 2016-07-27 11:41:08.456357000 +0900
+++ ext/openssl/ossl_ssl.c 2016-07-27 11:42:21.576357000 +0900
@@ -163,7 +163,8 @@
RTYPEDDATA_DATA(obj) = ctx;
SSL_CTX_set_ex_data(ctx, ossl_ssl_ex_ptr_idx, (void*)obj);
-#if !defined(OPENSSL_NO_EC) && defined(HAVE_SSL_CTX_SET_ECDH_AUTO)
+#if !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_ECDH) && \
+ defined(HAVE_SSL_CTX_SET_ECDH_AUTO)
/* We use SSL_CTX_set1_curves_list() to specify the curve used in ECDH. It
* allows to specify multiple curve names and OpenSSL will select
* automatically from them. In OpenSSL 1.0.2, the automatic selection has to
That's weird... OpenSSL 1.0.1 doesn't have SSL_CTX_set_ecdh_auto() so it shouldn't happen. Apparently you have another installation of OpenSSL 1.0.2, and ext/openssl was compiled with its headers but linked against the system OpenSSL. Please try reinstalling libssl-dev package and recompiling Ruby.
If ext/openssl is properly built with the system OpenSSL, it should print like this (OPENSSL_VERSION is the version number in the header and OPENSSL_LIBRARY_VERSION is the version number in the library itself):
$ ruby -ropenssl -e'puts OpenSSL::OPENSSL_VERSION, OpenSSL::OPENSSL_LIBRARY_VERSION'
OpenSSL 1.0.1f 6 Jan 2014
OpenSSL 1.0.1f 6 Jan 2014