mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Make fetch_url check the server's certificate on https connections
This commit is contained in:
parent
e59d4f3b51
commit
afc19894e1
2 changed files with 52 additions and 17 deletions
|
@ -25,3 +25,23 @@
|
|||
that:
|
||||
- result.changed
|
||||
- '"OK" in result.msg'
|
||||
|
||||
- name: test https fetch to a site with invalid domain
|
||||
get_url:
|
||||
url: "https://kennethreitz.org/"
|
||||
dest: "{{ output_dir }}/shouldnotexist.html"
|
||||
ignore_errors: True
|
||||
register: result
|
||||
|
||||
- stat:
|
||||
path: "{{ output_dir }}/shouldnotexist.html"
|
||||
register: stat_result
|
||||
|
||||
- debug: var=result
|
||||
|
||||
- name: Assert that the file was not downloaded
|
||||
assert:
|
||||
that:
|
||||
- "result.failed == true"
|
||||
- "'Certificate does not belong to ' in result.msg"
|
||||
- "stat_result.stat.exists == false"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue