diff options
Diffstat (limited to 'ansible_collections/community/general/plugins/callback/logentries.py')
-rw-r--r-- | ansible_collections/community/general/plugins/callback/logentries.py | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/ansible_collections/community/general/plugins/callback/logentries.py b/ansible_collections/community/general/plugins/callback/logentries.py index 22322a4df..d3feceb72 100644 --- a/ansible_collections/community/general/plugins/callback/logentries.py +++ b/ansible_collections/community/general/plugins/callback/logentries.py @@ -18,7 +18,7 @@ DOCUMENTATION = ''' requirements: - whitelisting in configuration - certifi (Python library) - - flatdict (Python library), if you want to use the 'flatten' option + - flatdict (Python library), if you want to use the O(flatten) option options: api: description: URI to the Logentries API. @@ -90,9 +90,9 @@ examples: > api = data.logentries.com port = 10000 tls_port = 20000 - use_tls = no + use_tls = true token = dd21fc88-f00a-43ff-b977-e3a4233c53af - flatten = False + flatten = false ''' import os @@ -196,15 +196,11 @@ else: class TLSSocketAppender(PlainTextSocketAppender): def open_connection(self): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - sock = ssl.wrap_socket( + context = ssl.create_default_context( + purpose=ssl.Purpose.SERVER_AUTH, + cafile=certifi.where(), ) + sock = context.wrap_socket( sock=sock, - keyfile=None, - certfile=None, - server_side=False, - cert_reqs=ssl.CERT_REQUIRED, - ssl_version=getattr( - ssl, 'PROTOCOL_TLSv1_2', ssl.PROTOCOL_TLSv1), - ca_certs=certifi.where(), do_handshake_on_connect=True, suppress_ragged_eofs=True, ) sock.connect((self.LE_API, self.LE_TLS_PORT)) |