implementation of SSL socket in C