Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[#9561] Check remote certificates for XMPP TLS #1147
[#9561] Check remote certificates for XMPP TLS #1147
Changes from all commits
488bdd0
0ff32b1
89954df
4759e27
fa18e8e
cadf08f
5ed194c
a1f4390
0a93949
751ac6f
672a633
fa1bc1b
a649757
ea2d28f
05556b6
7caf8ac
a66878c
abbf0fd
d99ce02
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are lots of other places which do this conditional import. Can we piggyback on one of them rather than adding bespoke
ImportError
-handling logic? My concern here is that this type of exception handling is likely to mask cases where there's an actual import-time bug intwisted.internet.ssl
and I don't want to have to go looking for 20 instances of this if we ever manage to go in and fix it to only fail on defined import errors (i.e. those wherecryptography
isn't available).Worst case, I'd rather literally import it from another
test_
module for the time being.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose this is due to the unconditional import of the
OpenSSL
module intwisted.internet.ssl
andtwisted.internet._sslverify
. The former module does have asupported
attribute, but it seems to (at least now) always be set to True, even though for exampletwisted.words.protocols.jabber.xmlstream
checks for that.If the
OpenSSL
module cannot be imported, the whole import fails, wheres I think my tests probably don't even use it.Can we not make
twisted.internet.ssl
do this conditional import and have it setsupported
toFalse
, andSSL
toNone
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@glyph I'm not sure if this should be addressed as part of this ticket?