Tutorial 10: OpenSSL 1: A simple connection without any security Using BIO
Following programs are basic implementation of BIO library. BIO is a abstraction library used to handle communication of various kinds, including files and sockets, both secure and not.for both secure and unsecure communication . Note: These programs are only for testing purpose and not optimize for production use. there may be some extra lines on code which are not used and still not removed. You will need openssl installed in your server to compile these programs. You can compile these two programs using gcc server.c -lssl -o server gcc client.c -lssl -o client Server: #include <stdio.h> #include <string .h> //for memset #include <openssl/ssl.h> #include <openssl/err.h> #include <openssl/bio.h> #define MAXCHARS 1024 int main(int argc, char *argv[]) { SSL_load_error_strings(); OpenSSL_add_all_algorithms(); char buf[MAXCHARS]; BIO *bio; if((bio = BIO_new_accept("port")) == NU