I am trying and using OpenSSL in C (on ubuntu 12.04). Took an example from here.
Everything goes well until BIO_do_connect() which returns a negative value. Probably I d
BIO_set_conn_ip() sets the IP address to ip using binary form, that is four bytes specifying the IP address in big-endian form. You are trying to write the IP in the little-endian form. Change the order of bytes like this:
ip[3] = 0b11000000;
ip[2] = 0b10100100;
ip[1] = 0b1;
ip[0] = 0b1110100;
Also, the IP you are trying to set is 192.164.1.116 which might be wrong if you were going for 192.168.1.116 (mind the 168 vs 164 part).