Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions journalpump/rsyslog.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,8 @@
if protocol is None:
protocol = "PLAINTEXT"
if cacerts is not None or protocol == "SSL":
self.ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS)
self.ssl_context = ssl.create_default_context(cafile=cacerts)
self.ssl_context.minimum_version = ssl.TLSVersion.TLSv1_2
self.ssl_context.verify_mode = ssl.CERT_REQUIRED
if cacerts:
self.ssl_context.load_verify_locations(cacerts)
if certfile:
self.ssl_context.load_cert_chain(certfile, keyfile)

Expand All @@ -131,7 +128,7 @@
self.socket = self.ssl_context.wrap_socket(self.socket, server_hostname=self.server)
self.socket.connect(sock_addr)
return
except Exception as ex: # pylint: disable=broad-except

Check failure

Code scanning / CodeQL

Use of insecure SSL/TLS version High

Insecure SSL/TLS protocol version TLSv1 allowed by
call to ssl.SSLContext
.
Insecure SSL/TLS protocol version TLSv1_1 allowed by
call to ssl.SSLContext
.
if self.socket is not None:
self.socket.close()
last_connection_error = ex
Expand Down