Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add python 3.12 support #1

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
433ab3e
Add python 3.12 support
blink1073 Oct 4, 2023
f16f36d
fix usage
blink1073 Oct 4, 2023
c90654c
fix usage
blink1073 Oct 4, 2023
61c5528
cleanup
blink1073 Oct 4, 2023
06f3a1f
fix cert handling
blink1073 Oct 4, 2023
22fc83c
add capath
blink1073 Oct 4, 2023
519cbdc
try loading default certs
blink1073 Oct 4, 2023
ec91215
cleanup
blink1073 Oct 4, 2023
a8e44f3
fixups
blink1073 Oct 4, 2023
eea62bd
cleanup
blink1073 Oct 4, 2023
4618b1d
Use all original options
blink1073 Oct 15, 2023
c3a5dbc
Revert "Use all original options"
blink1073 Mar 29, 2024
5a02eb7
Apply fix
blink1073 Mar 29, 2024
4d3b5a5
Fix compatibility with cryptography >= 42.0.0
kajinamit Mar 28, 2024
2897e40
address review
blink1073 Jul 25, 2024
cc035f4
address review
blink1073 Jul 26, 2024
d206639
fix client
blink1073 Jul 26, 2024
777c70d
lint
blink1073 Jul 26, 2024
64e4f18
Rely on close() to close sockets and stop using shutdown()
ShaneHarvey Aug 19, 2022
cb11131
Update supported python versions
kajinamit Mar 29, 2024
feec443
Remove deprecation warning in old python versions
kajinamit Apr 2, 2024
9d5b287
Revert "Rely on close() to close sockets and stop using shutdown()"
arp102 Jul 26, 2024
6cd44b5
Ignore ENOTCONN during shutdown
tipabu Jan 17, 2024
3da6f8d
remove extra check
blink1073 Jul 29, 2024
80faaf6
address review
blink1073 Nov 30, 2024
452693a
Merge branch 'master' of github.com:OpenKMIP/PyKMIP into remove-ssl-w…
blink1073 Dec 2, 2024
4b781ff
fix test
blink1073 Dec 2, 2024
529e123
address docs error
blink1073 Dec 2, 2024
da34f31
leave validation to the context
blink1073 Dec 2, 2024
1b46974
mock load_cert_chain
blink1073 Dec 2, 2024
8352de5
fix wrap
blink1073 Dec 2, 2024
042378b
fix stop test
blink1073 Dec 2, 2024
65c6993
fix stop test
blink1073 Dec 2, 2024
5b736ad
add python 3.13 support
blink1073 Dec 2, 2024
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
3 changes: 2 additions & 1 deletion .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
- {version: '3.9', env: py39}
- {version: '3.10', env: py310}
- {version: '3.11', env: py311}
- {version: '3.11', env: py312}
test_mode: [0, 1]
runs-on: ${{ matrix.os }}
env:
Expand All @@ -35,7 +36,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python: ['3.8', '3.9', '3.10', '3.11']
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
test: [pep8, bandit, docs]
runs-on: ${{ matrix.os }}
env:
Expand Down
3 changes: 2 additions & 1 deletion kmip/services/kmip_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@
six.reraise(*last_error)

def _create_socket(self, sock):
self.socket = ssl.wrap_socket(
context = ssl.create_default_context()
self.socket = context.wrap_socket(
Fixed Show fixed Hide fixed

Check failure

Code scanning / CodeQL

Use of insecure SSL/TLS version High

Insecure SSL/TLS protocol version TLSv1 allowed by
call to ssl.create_default_context
.
Insecure SSL/TLS protocol version TLSv1_1 allowed by
call to ssl.create_default_context
.
sock,
keyfile=self.keyfile,
certfile=self.certfile,
Expand Down
3 changes: 2 additions & 1 deletion kmip/services/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,8 @@
for cipher in auth_suite_ciphers:
self._logger.debug(cipher)

self._socket = ssl.wrap_socket(
context = ssl.create_default_context()
self._socket = context.wrap_socket(
Fixed Show fixed Hide fixed
self._socket,
keyfile=self.config.settings.get('key_path'),
certfile=self.config.settings.get('certificate_path'),
Expand Down
4 changes: 2 additions & 2 deletions kmip/tests/unit/services/server/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def test_start(self,
# Test that in ideal cases no errors are generated and the right
# log messages are.
with mock.patch('socket.socket') as socket_mock:
with mock.patch('ssl.wrap_socket') as ssl_mock:
with mock.patch('ssl.SSLContext.wrap_socket') as ssl_mock:
socket_mock.return_value = a_mock
ssl_mock.return_value = b_mock

Expand Down Expand Up @@ -271,7 +271,7 @@ def test_start(self,

# Test that a NetworkingError is generated if the socket bind fails.
with mock.patch('socket.socket') as socket_mock:
with mock.patch('ssl.wrap_socket') as ssl_mock:
with mock.patch('ssl.SSLContext.wrap_socket') as ssl_mock:
socket_mock.return_value = a_mock
ssl_mock.return_value = b_mock

Expand Down
Loading