def _context_factory_and_credential(path, host, port):
 ca = Certificate.loadPEM(path.child('cluster.crt').getContent())
 node_credential = NodeCredential.from_path(path, 'node')
 policy = ControlServicePolicy(ca_certificate=ca, client_credential=node_credential.credential)
 return _TLSContext(context_factory=policy.creatorForNetloc(host, port), node_credential=node_credential)

def _context_factory_and_credential ( path , host , port ) : ca = Certificate . loadPEM ( path . child ( 'cluster.crt' ) . getContent ( ) ) node_credential = NodeCredential . from_path ( path , 'node' ) policy = ControlServicePolicy ( ca_certificate = ca , client_credential = node_credential . credential ) return _TLSContext ( context_factory = policy . creatorForNetloc ( host , port ) , node_credential = node_credential )
load a tls context factory for the amp client from the path where configuration and certificates live .