#8 fix for ssl/https connection

closed-accepted
devel (5)
5
2002-07-28
2002-07-24
Andy Bach
No

I found on https connections failed on the 2nd connect
for 3.2b4 on Solaris and linux. I appear to have fixed
it by changing the SSLConnection destructor, adding a
ctx = NULL;
to
htnet/SSLConnection.cc
SSLConnection::~SSLConnection()
{
if ( ctx != NULL )
SSL_CTX_free(ctx);
ctx = NULL;
}

I'd added much debug to track it down to the failure in
SSLConnection::Connect, at the SSL_new(ctx) call for
the seg fault. ctx had the same value as when the first
connection, yet that connection was closed.
SSLConnection::InitSSL only inits if ctx is NULL so ...

Anyway, it seems to have fixed it. I did have to
manually alter include/htconfig.h to #define
HAVE_SSL_H HAVE_LIBSSL and HAVE_LIBCRYPTO
even though configure found ssl and -lssl -lcrypto got
added to the Makefiles as needed.

Discussion

  • Logged In: NO

    I had the same problem on Solaris 8. To get the make file
    to automatically define HAVE_SSL_H, I had to set the
    following environment variable:

    setenv CPPFLAGS "-I/usr/local/ssl/include
    -I/usr/local/ssl/include/openssl"

    HAVE_LIBSSL and HAVE_LIBCRYPTO don't get used in any of the
    code I could find, I left mine undefined, and after applying
    this patch, it worked as it should.
    Thanks for the fix!

     
    • assigned_to: nobody --> ghutchis
    • status: open --> closed-accepted
     
  • Logged In: YES
    user_id=21420

    I'll hunt down why the headers aren't located as well as the
    libraries. But the patch has been accepted. Thanks for the
    fix, it's obviously useful.

    -Geoff