(cherry picked from commit 78eca0eb5dee4d1c2192b07c3c73ef88b7e2219c)
Co-authored-by: Matt Clay <matt@mystile.com>
... | ... |
@@ -142,10 +142,17 @@ from ansible.module_utils._text import to_native |
142 | 142 |
# |
143 | 143 |
|
144 | 144 |
def main(): |
145 |
- tls_map = { |
|
146 |
- 'tlsv1.2': ssl.PROTOCOL_TLSv1_2, |
|
147 |
- 'tlsv1.1': ssl.PROTOCOL_TLSv1_1, |
|
148 |
- } |
|
145 |
+ tls_map = {} |
|
146 |
+ |
|
147 |
+ try: |
|
148 |
+ tls_map['tlsv1.2'] = ssl.PROTOCOL_TLSv1_2 |
|
149 |
+ except AttributeError: |
|
150 |
+ pass |
|
151 |
+ |
|
152 |
+ try: |
|
153 |
+ tls_map['tlsv1.1'] = ssl.PROTOCOL_TLSv1_1 |
|
154 |
+ except AttributeError: |
|
155 |
+ pass |
|
149 | 156 |
|
150 | 157 |
module = AnsibleModule( |
151 | 158 |
argument_spec=dict( |