I want to use SSL in my cross platform program. I decided to use OpenSSL.
I have OpenSSL installed, and at this point I am looking through the code and documentation trying to figure out how to use the library.
Do you have any resources or simple programs or tutorials that will walk me through integrating OpenSSL with my program?
from the "very rough guide" you mentioned, i managed to reach till successful SSL handshake, between mozilla web browser and my server(coded in c).But after SSL_accept, when am trying to use SSL_read to get the browser header details, am getting junk values and the bytes read are shown to be zero. below is the code, the SSL_accept call is successful but SSL_read is not..
The very rough guide is:
SSL_CTX
withSSL_CTX_new()
;SSL_CTX_use_certificate_file()
;SSL_CTX_use_PrivateKey_file()
;SSL
withSSL_new()
;SSL
to that of your network connection withSSL_set_fd()
;SSL_connect()
;SSL_accept()
.Thereafter use
SSL_read()
andSSL_write()
to read and write from the connection, and finish withSSL_shutdown()
. TheSSL_CTX
can be re-used to createSSL
objects for many simultaneous sessions.You can find some useful OpenSSL commands on this page:
http://www.networking4all.com/en/support/ssl+certificates/manuals/openssl/openssl+commands/