Hi,
this is a simple test program i wrote:

----------------------- code -------------------
  SSL_library_init ();
  SSL_load_error_strings();

  meth= SSLv23_method();
  ctx= SSL_CTX_new (meth);

  sock = socket (AF_INET, SOCK_STREAM, 0);
  host_p= gethostbyname (argv[1]);

  addr.sin_family= AF_INET;
  addr.sin_port= htons (atoi(argv[2]));
  memcpy (&addr.sin_addr, host_p->h_addr, sizeof (struct in_addr));

  connect (sock, (struct sockaddr *) &addr, sizeof (struct sockaddr_in));

  ssl=SSL_new(ctx);
  sbio=BIO_new_socket(sock,BIO_NOCLOSE);
  SSL_set_bio(ssl,sbio,sbio);
  SSL_connect(ssl);
  SSL_read(ssl,buf,sizeof(buf));
  printf ("%s", buf);
  SSL_write (ssl, "PBSZ 0\n", 7);
  while (SSL_read(ssl,buf,sizeof(buf)) > 0)
    printf ("%s\n", buf);
------------------------------- end code ------------------------

I cut all the error checks... can u see where am I wrong ?

Thank U :-)

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

Reply via email to