def _context_factory_and_credential(path, host, port):
    ca = Certificate.loadPEM(path.child(b"cluster.crt").getContent())
    # This is a hack; from_path should be more
    # flexible. https://clusterhq.atlassian.net/browse/FLOC-1865
    node_credential = NodeCredential.from_path(path, b"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
dataset/ETHPy150Open ClusterHQ/flocker/flocker/node/script.py/_context_factory_and_credential