I'm trying to enhance a simple command-line http client so that it handles
https too.  I'm on FreeBSD 3.2, and used the ports collection to install
OpenSSL 0.9.2b 22 Mar 1999 - not the latest version, but it's what many
of the prospective users will have.  The SSL code I'm using is basically
as follows, after doing the regular socket connect on fd:

    if ( ssl_ctx == (SSL_CTX*) 0 )
        {
        SSL_load_error_strings();
        SSLeay_add_ssl_algorithms();
        ssl_ctx = SSL_CTX_new( SSLv23_client_method() );
        }
    ssl = SSL_new( ssl_ctx );
    SSL_set_fd( ssl, fd );
    r = SSL_connect( ssl );
    if ( r <= 0 )
        {
        (void) fprintf( stderr, "SSL connection failed - %d\n", r );
        ERR_print_errors_fp( stderr );
        return;
        }

This is adapted from lynx-ssl and from demos/bio/sconnect.c in the OpenSSL
tree.  When I run it, the SSL_connect() always returns -1.  Also the
ERR_print_errors_fp() does no thing.

Any help?  Please include me in replies, I'm not on openssl-users.
---
Jef

         Jef Poskanzer  [EMAIL PROTECTED]  http://www.acme.com/jef/
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to