Install curl with openssl

2020-01-31 04:13发布

I just downloaded and installed OpenSSL from http://www.openssl.org/source/ [http://www.openssl.org/source/openssl-1.0.1c.tar.gz]

./config
make
make test
make install

Now I downloaded CURL - http://curl.haxx.se/download/curl-7.27.0.tar.gz. Trying to configure curl with openssl gives me below error -

.............................................................
checking for ssl with RSAglue/rsaref libs in use... checking for SSL_connect in -lssl... (cached) no
no
configure: error: OpenSSL libs and/or directories were not found where specified!
[root@curl-7.27.0]# ls -l /usr/local/ssl
total 40
drwxr-xr-x 2 root root  4096 Sep 28 01:21 bin
drwxr-xr-x 2 root root  4096 Sep 28 01:21 certs
drwxr-xr-x 3 root root  4096 Sep 28 01:21 include
drwxr-xr-x 4 root root  4096 Sep 28 01:21 lib
drwxr-xr-x 6 root root  4096 Sep 28 01:21 man
drwxr-xr-x 2 root root  4096 Sep 28 01:21 misc
-rw-r--r-- 1 root root 10835 Sep 28 01:21 openssl.cnf
drwxr-xr-x 2 root root  4096 Sep 28 01:21 private
[root@curl-7.27.0]#

I am not sure how I can fix this error?

标签: curl libcurl
3条回答
2楼-- · 2020-01-31 04:30

If you are on RHEL, and want to build curl (e.g. v7.45) with statically linked libs (standalone binary), you can also:

yum install openssl-devel # for headers and libraries
# run `./buildconf` if you cloned curl git repo
./configure --with-ssl=/usr/include/openssl --disable-shared
make

Your binary will be produced on ./src/curl.

openssl-devel version 1.0.1e installs:

/usr/include/openssl
/usr/include/openssl/aes.h
/usr/include/openssl/asn1.h
/usr/include/openssl/asn1_mac.h
/usr/include/openssl/asn1t.h
/usr/include/openssl/bio.h
/usr/include/openssl/blowfish.h
/usr/include/openssl/bn.h
/usr/include/openssl/buffer.h
/usr/include/openssl/camellia.h
/usr/include/openssl/cast.h
/usr/include/openssl/cmac.h
/usr/include/openssl/cms.h
/usr/include/openssl/comp.h
/usr/include/openssl/conf.h
/usr/include/openssl/conf_api.h
/usr/include/openssl/crypto.h
/usr/include/openssl/des.h
/usr/include/openssl/des_old.h
/usr/include/openssl/dh.h
/usr/include/openssl/dsa.h
/usr/include/openssl/dso.h
/usr/include/openssl/dtls1.h
/usr/include/openssl/e_os2.h
/usr/include/openssl/ebcdic.h
/usr/include/openssl/ec.h
/usr/include/openssl/ecdh.h
/usr/include/openssl/ecdsa.h
/usr/include/openssl/engine.h
/usr/include/openssl/err.h
/usr/include/openssl/evp.h
/usr/include/openssl/fips.h
/usr/include/openssl/fips_rand.h
/usr/include/openssl/hmac.h
/usr/include/openssl/idea.h
/usr/include/openssl/krb5_asn.h
/usr/include/openssl/kssl.h
/usr/include/openssl/lhash.h
/usr/include/openssl/md2.h
/usr/include/openssl/md4.h
/usr/include/openssl/md5.h
/usr/include/openssl/modes.h
/usr/include/openssl/obj_mac.h
/usr/include/openssl/objects.h
/usr/include/openssl/ocsp.h
/usr/include/openssl/opensslconf-x86_64.h
/usr/include/openssl/opensslconf.h
/usr/include/openssl/opensslv.h
/usr/include/openssl/ossl_typ.h
/usr/include/openssl/pem.h
/usr/include/openssl/pem2.h
/usr/include/openssl/pkcs12.h
/usr/include/openssl/pkcs7.h
/usr/include/openssl/pqueue.h
/usr/include/openssl/rand.h
/usr/include/openssl/rc2.h
/usr/include/openssl/rc4.h
/usr/include/openssl/ripemd.h
/usr/include/openssl/rsa.h
/usr/include/openssl/safestack.h
/usr/include/openssl/seed.h
/usr/include/openssl/sha.h
/usr/include/openssl/srtp.h
/usr/include/openssl/ssl.h
/usr/include/openssl/ssl2.h
/usr/include/openssl/ssl23.h
/usr/include/openssl/ssl3.h
/usr/include/openssl/stack.h
/usr/include/openssl/symhacks.h
/usr/include/openssl/tls1.h
/usr/include/openssl/ts.h
/usr/include/openssl/txt_db.h
/usr/include/openssl/ui.h
/usr/include/openssl/ui_compat.h
/usr/include/openssl/whrlpool.h
/usr/include/openssl/x509.h
/usr/include/openssl/x509_vfy.h
/usr/include/openssl/x509v3.h
/usr/lib64/libcrypto.so
/usr/lib64/libssl.so
/usr/lib64/pkgconfig/libcrypto.pc
/usr/lib64/pkgconfig/libssl.pc
/usr/lib64/pkgconfig/openssl.pc
查看更多
劳资没心,怎么记你
3楼-- · 2020-01-31 04:34

Solve this problem with flag --with-darwinssl

Go to folder with curl source code

Download it here https://curl.haxx.se/download.html

sudo ./configure --with-darwinssl
make
make install

restart your console and it is done!

查看更多
家丑人穷心不美
4楼-- · 2020-01-31 04:38

Try this when you configure the libcurl

./configure --with-ssl --with-libssl-prefix=/usr/local/ssl

/usr/local/ssl is where openssl contains header files and library

/usr/local/ssl/
├── bin
├── certs
├── include
├── lib
├── man
├── misc
├── openssl.cnf
└── private
查看更多
登录 后发表回答