curl-users
Re: curl with SSL
Date: Tue, 15 Aug 2000 23:38:35 +0200 (MET DST)
On Tue, 15 Aug 2000, Claude Cormier wrote:
> Guys... My first 5 days in the Unix world have not been a vacation but I
> will get through it.
I think you're catching on pretty quick. Overcoming problems are sometimes
the best way to learn new things! ;-) (Trying to get a positive angle on all
these troubles!)
Ok, let's shoot!
> setenv CPPFLAGS -I/usr//local/include/openssl
> setenv LDFLAGS -L/usr/local/lib
>
> 5) (I am going with the non-static compile)
> ./configure
> --with-ssl=/usr/local
> --prefix=/u/me
> --mandir=/u/me/man
You need to pay attention to the configure output. After some 20-30 lines
there should be two lines that say:
checking for CRYPTO_lock in -lcrypto... yes
checking for SSL_connect in -lssl... yes
If the configure script doesn't find the six required include files *and* the
two required lib files, it won't build curl with SSL support.
> 6) At this point I tried a make install and it works fine for HTTP: but
> HTTPS is not supported. I no longer have the problem to access the .h
> files, however the problem mentioned by Jochen with the lib not being
> picked up because of -lcrypto appears:
>
> configure:2674: checking for gethostbyname_r
> configure:2702: gcc -o conftest -g -O2 -I/usr/local/include/openssl
> -I/usr/local/include/openssl -I/usr/local/include -L/usr/local/lib
> conftest.c -lssl -lcrypto -L/usr/local/lib 1>&5
> configure:2696: Undefined symbol `_gethostbyname_r' referenced from text
> segment
> configure: failed program was:
> #line 2679 "configure"
No, that problem has nothing to do with SSL. That's a test for the presense
of a gethostbyname_r() function. It appears your system does not have such a
function.
> So as suggested by Jochen I went manually into /curl-7.1/src/makefile
> and /curl-7.1/lib/makefile and change
>
> LIBS = -lssl -lcrypto -L/usr/local/lib
> to
> LIBS = -L/usr/local/lib -lssl -lcrypto
If the configure script found the libs allright, you shouldn't need that
change. If you'd need such a change, the right place to do the edit would be
in the src/Makefile as that's the place where those libs are required.
If you want to mock with the Makefiles manually to get this working, you must
make sure to edit the config.h file to match your preferences. Most notably,
for SSL to become enabled there are *eight* defines that must be set to 1,
and they are:
#define HAVE_OPENSSL_CRYPTO_H 1
#define HAVE_OPENSSL_ERR_H 1
#define HAVE_OPENSSL_PEM_H 1
#define HAVE_OPENSSL_RSA_H 1
#define HAVE_OPENSSL_SSL_H 1
#define HAVE_OPENSSL_X509_H 1
#define HAVE_LIBCRYPTO 1
#define HAVE_LIBSSL 1
> 7) now I checked again config.log and found that
>
> alloca.h, getopt.h, termio.h, winsock.h and io.h are not found. Could
> this be a problem?
Nope, those are not required. The configure script is just checking your
system setup, not finding every file it checks for is just normal. No system
have all those files.
> or the openssl lib is still not OK ??
I would also like to point to section 1.1.2 of the FAQ (in docs/ or on the
web site) in case you do have the RSAREF stuff in a separate lib for your
openssl. In that case configure won't find the ssl lib properly.
-- Daniel Stenberg - http://daniel.haxx.se - +46-705-44 31 77 ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`olReceived on 2000-08-15