added sample code from O'Reilly OpenSSL book