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

Fix problem caused by SSL_WANT_READ or SSL_WANT_WRITE errors. #1242

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
5 changes: 4 additions & 1 deletion src/OpenSSL/SSL.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions tests/test_crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down