summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToshio Kuratomi <toshio@fedoraproject.org>2015-05-28 15:33:21 -0700
committerToshio Kuratomi <toshio@fedoraproject.org>2015-05-29 08:50:04 -0700
commit191a672891359f3b6faff83cb0613f1b38e3fc0e (patch)
tree90c09f73347403be05c84a9b07771975c0257445
parent02edb2e87774fe3178228b9329af82ce755f6a12 (diff)
downloadansible-modules-core-v2_command.tar.gz
Properly flip default for verifying server cert. Add nice error messages when the cert is invalidv2_command
-rw-r--r--network/basics/uri.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/network/basics/uri.py b/network/basics/uri.py
index 5396a0a5..6138edbf 100644
--- a/network/basics/uri.py
+++ b/network/basics/uri.py
@@ -350,6 +350,10 @@ def uri(module, url, dest, user, password, body, body_format, method, headers, r
module.fail_json(msg="The server requested a type of HMACDigest authentication that we are unfamiliar with.")
except httplib2.UnimplementedHmacDigestAuthOptionError:
module.fail_json(msg="The server requested a type of HMACDigest authentication that we are unfamiliar with.")
+ except httplib2.CertificateHostnameMismatch:
+ module.fail_json(msg="The server's certificate does not match with its hostname.")
+ except httplib2.SSLHandshakeError:
+ module.fail_json(msg="Unable to validate server's certificate against available CA certs.")
except socket.error, e:
module.fail_json(msg="Socket error: %s to %s" % (e, url))
@@ -371,7 +375,7 @@ def main():
removes = dict(required=False, default=None),
status_code = dict(required=False, default=[200], type='list'),
timeout = dict(required=False, default=30, type='int'),
- validate_certs = dict(required=False, default=False, type='bool'),
+ validate_certs = dict(required=False, default=True, type='bool'),
),
check_invalid_arguments=False,
add_file_common_args=True