Update to OpenSSL 1.0.1g and fix build on OS X