Fixes #18: segfault during SSL connections

Segfaults were occurring on SSL connections due to the lack of using `withOpenSSL` monad.