diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2016-04-24 15:22:44 -0700 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2016-04-24 15:22:44 -0700 |
commit | f198a69ac50c568e4547cc2cb5025e260bc8dcfd (patch) | |
tree | 246ba18de9894ab572d8bb6f715600e17ebe4a0a | |
parent | 8311ad95adbfefa681f1c827c047a740f46f11fc (diff) | |
parent | 634032fbdcc877b26b34a5a4ea26c05340f93b1d (diff) |
Merge branch '1.15' into 1.16
-rw-r--r-- | paramiko/client.py | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/paramiko/client.py b/paramiko/client.py index 8d899a15..e3d3780e 100644 --- a/paramiko/client.py +++ b/paramiko/client.py @@ -164,10 +164,23 @@ class SSHClient (ClosingContextManager): def set_missing_host_key_policy(self, policy): """ - Set the policy to use when connecting to a server that doesn't have a - host key in either the system or local `.HostKeys` objects. The - default policy is to reject all unknown servers (using `.RejectPolicy`). - You may substitute `.AutoAddPolicy` or write your own policy class. + Set policy to use when connecting to servers without a known host key. + + Specifically: + + * A **policy** is an instance of a "policy class", namely some subclass + of `.MissingHostKeyPolicy` such as `.RejectPolicy` (the default), + `.AutoAddPolicy`, `.WarningPolicy`, or a user-created subclass. + + .. note:: + This method takes class **instances**, not **classes** themselves. + Thus it must be called as e.g. + ``.set_missing_host_key_policy(WarningPolicy())`` and *not* + ``.set_missing_host_key_policy(WarningPolicy)``. + + * A host key is **known** when it appears in the client object's cached + host keys structures (those manipulated by `load_system_host_keys` + and/or `load_host_keys`). :param .MissingHostKeyPolicy policy: the policy to use when receiving a host key from a |