Fixed segfault when built with OpenSSL >= 1.0.1

(PR #481)