Skip to content

Commit

Permalink
Merge pull request #12 from ovh/dev/pierre.frayer/wrap_socket
Browse files Browse the repository at this point in the history
fix: remove deprecated ssl.wrap_socket, use SSLContext.wrap_socket instead
  • Loading branch information
cdumay authored Jan 16, 2024
2 parents cf48fc6 + ad1bc69 commit f5f9730
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.31
0.0.32
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
marshmallow>=3.0.0
setuptools
8 changes: 5 additions & 3 deletions src/logging_gelf/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ def makeSocket(self, timeout=1, **kwargs):
)

if self.use_tls is True:
return ssl.wrap_socket(
sock, cert_reqs=self.cert_reqs, ca_certs=self.ca_certs
)
context = ssl.SSLContext(ssl.PROTOCOL_TLS)
context.verify_mode = self.cert_reqs
if self.ca_certs:
context.load_verify_locations(self.ca_certs)
return context.wrap_socket(sock=sock)
return sock

def makePickle(self, record):
Expand Down

0 comments on commit f5f9730

Please sign in to comment.