Cannot configure OpenVPN 2.4.7 with OpenSSL 1.1.1c

This forum is for all inquiries relating to the installation of OpenVPN from source and with binaries.
Forum rules
Please visit (and READ) the OpenVPN HowTo prior to asking any questions in here!
Post Reply
OpenVpn Newbie
Posts: 14
Joined: Wed May 31, 2017 12:58 am

Cannot configure OpenVPN 2.4.7 with OpenSSL 1.1.1c

Post by banjo » Thu Aug 15, 2019 10:07 pm

Hello all

I run a test version of the Raspberry Pi Desktop (RPD), which is based on Debian Stretch, in a VM on VirtualBox running on Windows 10. Amongst other reasons, that configuration allows me to test changes and upgrades to my Raspberry Pi, in particular to OpenSSL and OpenVPN, which is why I am here asking someone to try and fix this often asked about problem.

The RPD image came with OpenSSL 1.1.0k pre-installed. I wanted to compile the latest versions of OpenSSL and OpenVPN and did not want to affect the already installed OpenSSL in any way.

So, I followed the standard procedure and compiled OpenSSL 1.1.1c into the /usr/local/ssl libraries. This is a non shared installation. After this, both of the installed versions of OpenSSL identify their version as expected.

However, when attempting to configure OpenVPN 2.4.7 to use the newly installed OpenSSL using the following command:

Code: Select all

./configure OPENSSL_CFLAGS="-I/usr/local/ssl/include" OPENSSL_LIBS="-L/usr/local/ssl/lib -lssl -lcrypto -ldl"
the configuration script fails. The final two lines are

Code: Select all

checking for SSL_CTX_new... no
configure: error: openssl check failed
Looking in config.log around the CTX check, I see a number messages similar to
the following:

Code: Select all

/usr/local/ssl/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_lock_new':
threads_pthread.c:(.text+0x61): undefined reference to `pthread_rwlock_init'
/usr/local/ssl/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_read_lock':
threads_pthread.c:(.text+0xa4): undefined reference to `pthread_rwlock_rdlock'
/usr/local/ssl/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_write_lock':
threads_pthread.c:(.text+0xd4): undefined reference to `pthread_rwlock_wrlock'
/usr/local/ssl/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_unlock':
threads_pthread.c:(.text+0x104): undefined reference to `pthread_rwlock_unlock'
/usr/local/ssl/lib/libcrypto.a(threads_pthread.o): In function `CRYPTO_THREAD_lock_free':
threads_pthread.c:(.text+0x13d): undefined reference to `pthread_rwlock_destroy'
BTW: I note that the configuration help says that OPENSSL_LIBS is used to supply linker flags. Is that correct and if so why _LIBS and what variable should I use for the libraries ??

If I attempt to run a vanilla configure (./configure), the process works and OpenVPN 2.4.7 is built properly but (of course) uses OpenVPN 1.1.0k and not the one that I have just installed and wish to use.

If anyone is interested in simulating this issue, the RPD can be downloaded from the Raspberry
Pi website: If you are going to simulate, the
VM must be based on a Debian 32bit OS

I am not a Unix person but am technically OK so I might ask supplementary questions if I can't grasp what you're talking about.

Thanks in advance


Post Reply