Urls client cert auth (#18141)

* Build HTTPSClientAuthHandler more similarly to how HTTPSHandler works

* Add docs for new client cert authentication

* Support older versions of python

* Simplify logic

* Initial support for client certs in urls.py

* Add an extra test

* Add a get_url test for client cert auth

* Add additional test for client cert auth, with validation and ssl mismatch

* Skip assert when http tester not available

* Update version_added for new options
This commit is contained in:
Matt Martz 2017-04-07 11:54:37 -05:00 committed by Toshio Kuratomi
commit 621e27b5dd
6 changed files with 138 additions and 4 deletions

View file

@ -211,3 +211,18 @@
get_url:
url: https://{{ httpbin_host }}
dest: "{{ output_dir }}"
- name: Test client cert auth, with certs
get_url:
url: "https://ansible.http.tests/ssl_client_verify"
client_cert: "{{ output_dir }}/client.pem"
client_key: "{{ output_dir }}/client.key"
dest: "{{ output_dir }}/ssl_client_verify"
when: has_httptester
- name: Assert that the ssl_client_verify file contains the correct content
assert:
that:
- 'lookup("file", "{{ output_dir }}/ssl_client_verify") == "ansible.http.tests:SUCCESS"'
when: has_httptester