I did a project very similar to yours. Assuming you know how to handle
blocking and non-blocking sockets using SSL (and reuse the SSL structure, if
you want), initialization is a cinch. Refer to the cli.cpp and serv.cpp
example written by sampo kellomaki in demos/ssl. You will find all the info
you need there.

Arun.

-----Original Message-----
From: Michael Sandler <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Tuesday, May 23, 2000 2:54 PM
Subject: Win32 web server using ssl


>My company wants me to integrate SSL into our custom web server.  I already
asked for help with this back in March, and responses were very helpful.
Have been away from ssl working on another project, and now I am back, and
unfortunately still lost.
>
>I've read through (or tried to anyways) the s_server code.  While I am sure
that the answer is somewhere in there, I am not familiar with bios and have
been unable to extract the needed info from there.
>
>I would like to add ssl support without using bios, just straight sockets
(at least that way i am working with something I understand).
>
>So say my basic server looks something like this:
>
>...
>  parent = socket(AF_INET, SOCK_STREAM, 0);
>...
>  bind(parent, (struct sockaddr*)&serveraddr, sizeof(serveraddr));
>...
>  listen(parent, 5);
>  while(1){
>    child = accept(parent, (struct sockaddr *) &clientaddr, &clientlen);
>    thread_id = _beginthread(process_conn, 0, (void *) &child);
>  }
>...
>
>process_conn then handles the newly accepted connection, and has this code:
>
>void process_conn(void * ptr){
>  SOCKET sock = *(SOCKET*)ptr;
>...
>  size = recv(sock, read_buffer, sizeof(read_buffer) - 1, 0);
>...
>  send(sock, write_buffer, size, 0);
>...
>}
>
>
>I assume that recv() needs to be replaced with SSL_read(), and send() with
SSL_write().  However I have no idea what needs to be done to initialize
SSL, and do the handshaking for the connection.  At first I looked to the
programs in \demos  but unfortunately the relevant ones seem to be written
against an older version of the API, and were only of marginal use.
>
>I would greately appreciate any help with this matter.
>          Thanks
>              -Mike Sandler
>
>______________________________________________________________________
>OpenSSL Project                                 http://www.openssl.org
>User Support Mailing List                    [EMAIL PROTECTED]
>Automated List Manager                           [EMAIL PROTECTED]
>
"The online world is a cool place to visit, but you really don't want to
live there."


****************************************************************
This message is for the named person(s) use only.  It may contain
confidential, proprietary or legally privileged information.  No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please immediately delete it and
all copies of it from your system, destroy any hard copies of it and
notify the sender.  You must not, directly or indirectly, use, disclose,
distribute, print, or copy any part of this message if you are not the
intended recipient. SPEEDERA NETWORKS, INC. reserves the right to
monitor all e-mail communications through its network.


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

Reply via email to