109

I was trying to install node.js and found OpenSSL support missing during ./configure.

How can I fix it? Is it a mandatory step? Would the --without-ssl option fix the problem?

# ./configure

Checking for gcc                         : ok
Checking for library dl                  : not found
Checking for openssl                     : not found
Checking for function SSL_library_init   : not found
Checking for header openssl/crypto.h     : not found
/home/ec2-user/node-v0.6.6/wscript:374: error: Could not autodetect OpenSSL 
                                               support.

Make sure OpenSSL development packages are installed. Use configure --without-ssl 
to disable this message.
Bradd Szonye
  • 1,239
  • 8
  • 14
P K
  • 2,183
  • 11
  • 29
  • 32
  • For me in my Debian 9 (ubuntu) : apt update && apt install -y openssl && apt install -y libc6 && apt install -y libssl1.1 && apt install -y ca-certificates and then ./configure – FranklinA Dec 12 '19 at 15:36

6 Answers6

191

Yes, it's a mandatory step. You cannot remove OpenSSL from a program uses it, the same way you couldn't remove random engine parts from a car.

The OpenSSL library is usually already installed, but you have to install the header files. Depending on your Linux distribution, you'll need these packages:

  • Red Hat, Fedora, CentOS - openssl-devel
  • Debian, Ubuntu - libssl-dev
  • Arch - openssl

Technically one could replace OpenSSL with, say, NSS, but that's not the point here.

u1686_grawity
  • 426,297
  • 64
  • 894
  • 966
  • 2
    thanks a lot, i installed header by yum install openssl-devel – P K Dec 27 '11 at 11:00
  • Ah makes sense now. This is needed for wget to ./configure with ssl as well. – dhaupin Jul 12 '16 at 18:48
  • 4
    After using [grawitys answer](https://superuser.com/a/371912/743888) while trying to configure squid (3.5.26) with openssl I've stumbled onto some weird side effect: Unless you have "pkg-config" installed, the library "openssl" and "libssl-dev" gets treated as if it was missing. So I had to install pkg-config as well. It is used in the configure script (around line 23362) to find the path and existence of this package. On debian it is installed by: > `apt-get install pkg-config` – Mihovil Bubnjar Jun 30 '17 at 08:22
  • @MihovilBubnjar got an error "configure: error: library 'ssl' is required for OpenSSL" when tried to build squid with ssl, install pkg-config fixed this error – Sergio Ivanuzzo Oct 30 '21 at 11:05
12

debian:

apt-get install libssl-dev

apt-get install linux-headers-$(uname -r)
Kevin Panko
  • 7,346
  • 22
  • 44
  • 53
Albert E
  • 121
  • 1
  • 2
5

No, it isn't.

You can still compile nodejs with ./configure --without-ssl

Kevin Panko
  • 7,346
  • 22
  • 44
  • 53
grigoris
  • 51
  • 1
  • 1
2

This is showing up on Google for a problem that may come up with some installations - possibly links-g. I had the problem on Archlinux with links-utf8 and links-g-directfb.

Likely presentation:

checking OPENSSL_CFLAGS... 
checking OPENSSL_LIBS... -lssl -lcrypto 
checking for OpenSSL... no
configure: error: OpenSSL not found

Try this:

sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" configure

Using this command before your ./configure step should fix it.

Kevin Panko
  • 7,346
  • 22
  • 44
  • 53
2

You must install openssl-devel in your OS with:

yum install openssl-devel.x86_64

./configure --with-tls

make install

Leathe
  • 764
  • 4
  • 11
0

If you don't succeed with libssl-dev only, over Debian distro, you could include both SSL Library versions same time

apt-get install libssl-dev libssl1.0
PYK
  • 131
  • 4