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

Expose SSL_OP_IGNORE_UNEXPECTED_EOF #1127

Merged
merged 1 commit into from
Jun 9, 2022
Merged

Expose SSL_OP_IGNORE_UNEXPECTED_EOF #1127

merged 1 commit into from
Jun 9, 2022

Conversation

dreid
Copy link
Contributor

@dreid dreid commented Jun 9, 2022

This was added to pyca/cryptography at pyca/cryptography@0fe4583

This was added to pyca/cryptography at pyca/cryptography@0fe4583
@dreid dreid marked this pull request as ready for review June 9, 2022 16:26
@alex alex merged commit bd02327 into pyca:main Jun 9, 2022
@0xflux
Copy link

0xflux commented Oct 11, 2022

@dreid hey, I hope you don't mind me asking this here - how would you go about setting SSL_OP_IGNORE_UNEXPECTED_EOF to True via the pyopenssl api? I'm running into this error with openssl and I think the reason is I need this flag to be true urlopen error TLS/SSL connection has been closed (EOF) (_ssl.c:997)

@bnavigator
Copy link
Contributor

bnavigator commented Oct 20, 2022

From the eventlet test suite:

[  207s] _________________________________ test_import __________________________________
[  207s] 
[  207s]     def test_import():
[  207s]         # https://github.com/eventlet/eventlet/issues/238
[  207s]         # Ensure that it's possible to import eventlet.green.OpenSSL.
[  207s]         # Most basic test to check Python 3 compatibility.
[  207s]         try:
[  207s]             import OpenSSL
[  207s]         except ImportError:
[  207s]             raise tests.SkipTest('need pyopenssl')
[  207s]     
[  207s] >       import eventlet.green.OpenSSL.SSL
[  207s] 
[  207s] tests/openssl_test.py:13: 
[  207s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[  207s] eventlet/green/OpenSSL/__init__.py:2: in <module>
[  207s]     from . import SSL
[  207s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[  207s] 
[  207s]     from OpenSSL import SSL as orig_SSL
[  207s] >   from OpenSSL.SSL import *
[  207s] E   AttributeError: module 'OpenSSL.SSL' has no attribute 'OP_IGNORE_UNEXPECTED_EOF'
[  207s] 
[  207s] eventlet/green/OpenSSL/SSL.py:2: AttributeError

Edit: I see that you "fixed" your release and made clear that cryptography needs to be at 0.38.0. Then the error won't happen.

This still happens with cryptography 0.38.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants