#NEWLINE# def _context_factory_and_credential( path , host , port ) : #NEWLINE# #INDENT# '\n    Load a TLS context factory for the AMP client from the path where\n    configuration and certificates live.\n\n    The CA certificate and node private key and certificate are expected\n    to be siblings of the configuration file.\n\n    :param FilePath path: Path to directory where configuration lives.\n    :param bytes host: The host we will be connecting to.\n    :param int port: The port we will be connecting to.\n\n    :return: ``_TLSContext`` instance.\n    ' #NEWLINE# ca = Certificate . loadPEM ( path . child ( b'cluster.crt' ) . getContent ( ) ) #NEWLINE# node_credential = NodeCredential . from_path ( path , b'node' ) #NEWLINE# policy = ControlServicePolicy ( ca_certificate = ca , client_credential = node_credential . credential ) #NEWLINE# return _TLSContext ( context_factory = policy . creatorForNetloc ( path , port ) , node_credential = node_credential )