#NEWLINE# def _ssl_handshake( self ) : #NEWLINE# #INDENT# '\n            Perform an SSL handshake w/ the server.\n            Precondition: a successful STARTTLS exchange has\n                         taken place with Riak\n            returns True upon success, otherwise an exception is raised\n            ' #NEWLINE# credentials = self . _client . _credentials #NEWLINE# if credentials : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# ssl_ctx = configure_ssl_context ( credentials ) #NEWLINE# host = self . _address [ 0 ] #NEWLINE# ssl_socket = ssl . SSLSocket ( sock = ssl_socket . _socket , keyfile = credentials . pkey_file , certfile = credentials . cert_file , cert_reqs = ssl . CERT_REQUIRED , ca_certs = credentials . cacert_file , ciphers = credentials . ciphers , server_hostname = host ) #NEWLINE# ssl_socket . context = ssl_ctx #NEWLINE# ssl_socket . do_handshake ( ) #NEWLINE# self . _socket = ssl_socket #NEWLINE# return True #NEWLINE# #UNINDENT# except ssl . SSLError as e : #NEWLINE# #INDENT# raise SecurityError ( e ) #NEWLINE# #UNINDENT# except Exception as e : #NEWLINE# #INDENT# raise SecurityError ( e )