-
Notifications
You must be signed in to change notification settings - Fork 21
feat: Add makeMaybe method to SslContextModule #183
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
Conversation
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.
The potentially problematic aspect of this solution is that if the caller uses make
, it will always create an SSLContext
(right?), even if enabled
is set to false
in configuration.
That's quite surprising and probably not what we want. Any suggestions how to remedy that?
We could throw in make
if enabled
is false 🤷♂️
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.
Shouldn't you update reference.conf as well?
huh, the bot is really happy with merging stuff 😄 |
@hanny24 I could add it but I see it as an extra feature not everyone needs. @sideeffffect Related to the think I say above, I don't want I agree this is a small hack but it seems to me that it's not really harmful but can be very useful - I have the use case that's why I am adding it. |
Of course we can revert this or update accordingly, the merge was premature - it's configured that once you have an approval you can merge. You shouldn't approve if you have doubts about anything. |
it wouldn't be nice, but isn't it better to have at least some "safety" guarantee? could others chime in? @tomasherman @jendakol @augi |
But you have just broken backwards compatibility. |
@hanny24 How did I break it? Method @sideeffffect Yep, that would be possible. I wouldn't worry about breaking compatibility right now because we are still not fully released. The point is that I think most people will use |
Ahh, sorry I thought it was changed method, not added. |
Breaking backward compatibility is not an issue IMHO if the change is important:
|
After thinking about this for a bit, I realized that the aspect of this PR that was bothering me was that the SSLContext is enabled by default, and you have to explicitly opt out of it, but you do that by using variable In general, I think there should be a rule that config variables should not be negatives, it makes for clearer reading, but maybe this case would be an exception from the rule. the name |
Another option would be to backpedal on this PR, and resolve the problem @jakubjanecek described differently, possibly in (test I presume) code. Or keep like it is... no biggie |
It is sometimes necessary to turn off the initialization of SSL context to actually turn off SSL functionality of some library (e.g. for testing). This method makes it more simple by having an
enabled
flag in the configuration.