111

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.
B. Szonye
  • 1,269
P K
  • 2,233

6 Answers6

193

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.

grawity
  • 501,077
13

debian:

apt-get install libssl-dev

apt-get install linux-headers-$(uname -r)
Kevin Panko
  • 7,466
Albert E
  • 131
5

No, it isn't.

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

Kevin Panko
  • 7,466
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,466
2

You must install openssl-devel in your OS with:

yum install openssl-devel.x86_64

./configure --with-tls

make install

Leathe
  • 754
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
  • 141