diff --git a/setup.py b/setup.py index 3f27e12dd..a9315d048 100644 --- a/setup.py +++ b/setup.py @@ -96,7 +96,7 @@ def find_meta(meta): packages=find_packages(where="src"), package_dir={"": "src"}, install_requires=[ - "cryptography>=41.0.0,<42", + "cryptography>=42.0.0", ], extras_require={ "test": ["flaky", "pretend", "pytest>=3.0.1"], diff --git a/src/OpenSSL/SSL.py b/src/OpenSSL/SSL.py index a0d0b6acb..013c86dde 100644 --- a/src/OpenSSL/SSL.py +++ b/src/OpenSSL/SSL.py @@ -850,7 +850,10 @@ def __init__(self, method): self._cookie_generate_helper = None self._cookie_verify_helper = None - self.set_mode(_lib.SSL_MODE_ENABLE_PARTIAL_WRITE) + self.set_mode( + _lib.SSL_MODE_ENABLE_PARTIAL_WRITE + | _lib.SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER + ) if version is not None: self.set_min_proto_version(version) self.set_max_proto_version(version) diff --git a/tests/test_crypto.py b/tests/test_crypto.py index cb2140c3d..cad644c3b 100644 --- a/tests/test_crypto.py +++ b/tests/test_crypto.py @@ -1738,7 +1738,7 @@ def test_construction(self): certificate = X509() assert isinstance(certificate, X509) assert type(certificate).__name__ == "X509" - assert type(certificate) == X509 + assert type(certificate) is X509 def test_set_version_wrong_args(self): """ @@ -3146,7 +3146,7 @@ def test_construction(self): """ revoked = Revoked() assert isinstance(revoked, Revoked) - assert type(revoked) == Revoked + assert type(revoked) is Revoked assert revoked.get_serial() == b"00" assert revoked.get_rev_date() is None assert revoked.get_reason() is None @@ -3441,8 +3441,8 @@ def test_get_revoked(self): revs = crl.get_revoked() assert len(revs) == 2 - assert type(revs[0]) == Revoked - assert type(revs[1]) == Revoked + assert type(revs[0]) is Revoked + assert type(revs[1]) is Revoked assert revs[0].get_serial() == b"03AB" assert revs[1].get_serial() == b"0100" assert revs[0].get_rev_date() == now diff --git a/tests/test_ssl.py b/tests/test_ssl.py index 369f6a6d7..32e43d228 100644 --- a/tests/test_ssl.py +++ b/tests/test_ssl.py @@ -191,7 +191,7 @@ def join_bytes_or_unicode(prefix, suffix): The return type is the same as the type of ``prefix``. """ # If the types are the same, nothing special is necessary. - if type(prefix) == type(suffix): + if type(prefix) is type(suffix): return join(prefix, suffix) # Otherwise, coerce suffix to the type of prefix. diff --git a/tox.ini b/tox.ini index 94d420723..8fe87c86b 100644 --- a/tox.ini +++ b/tox.ini @@ -18,7 +18,7 @@ extras = test deps = coverage>=4.2 - cryptographyMinimum: cryptography==38.0.0 + cryptographyMinimum: cryptography==41.0.3 randomorder: pytest-randomly setenv = # Do not allow the executing environment to pollute the test environment