Has anyone else had any issues with SunOS and openSSL?
I'm running OpenSSL 0.9.6 and I've written an extremely simple program
that just tries to connect to the secure port of a webserver. On my
Linux box it appears to work fine but when I run it on my SunOS box the
connect always fails. Not only does the connect fail, but if I add a
ERR_print_errors() call after the SSL_connect call the program seg
faults.
Any help/advice would be greatly appriciated!
I've attached to code to this message as it is so short (I've excluded
the headers). The output from this program on the Sun box is:
> ./ssltest
SSL_connect: -1
Segmentation Fault(coredump)
>
Jason
--- ssltest.c
------------------------------------------------------------
int main( void )
{
int sock;
struct sockaddr_in sSockAddr;
struct hostent *spHostEnt;
SSL_CTX *ctx = NULL;
SSL_METHOD *meth = NULL;
SSL *ssl = NULL;
sSockAddr.sin_family = AF_INET;
sSockAddr.sin_port = htons( 443 );
spHostEnt = gethostbyname( "www.csi.ca" );
memcpy( &(sSockAddr.sin_addr.s_addr),
spHostEnt->h_addr_list[0],
spHostEnt->h_length );
sock = socket( AF_INET, SOCK_STREAM, 0 );
connect( sock, (struct sockaddr *)&sSockAddr, sizeof( sSockAddr ));
SSLeay_add_ssl_algorithms();
meth = SSLv2_client_method();
SSL_load_error_strings();
ctx = SSL_CTX_new(meth);
ssl = SSL_new( ctx );
SSL_set_fd( ssl, sock );
ERR_print_errors();
printf( "SSL_connect: %d\n", SSL_connect( ssl ) );
ERR_print_errors();
}
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]