-
Notifications
You must be signed in to change notification settings - Fork 24
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
Assert TLS configuration when booting MongoosePush #192
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.
Thanks for adding the cipher suites check at application startup. This clearly defines why the app couldn't start. I had just one cosmetic suggestion, just let me know if you want to change the code or not.
The PR is ready to be merged with or without addressing my comment.
lib/mongoose_push/application.ex
Outdated
Enum.filter(all_ciphers, fn cipher -> | ||
case cipher do | ||
{:ecdhe_rsa, :aes_128_gcm, _, :sha256} -> | ||
true | ||
|
||
{:ecdhe_rsa, :aes_256_gcm, _, :sha384} -> | ||
true | ||
|
||
_ -> | ||
false | ||
end | ||
end) |
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.
Just a cosmetic thing. It looks like to me, that Enum.any?
could be used instead of Enum.fiter
, thanks to that we'll have the answer immediately, without the need to calculate the length of the new list.
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.
Corrected. But in exchange we've lost the underscore and have to match to :aead
directly.
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 think the previous fun
used with filter
would work as well. Anyway, thanks for applying my suggestion.
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.
Looks good. Thanks for adding this.
The purpose of this PR is to prevent MPush from start when APNS required ciphers (
ECDHE-RSA-AES128-GCM-SHA256
andECDHE-RSA-AES256-GCM-SHA384
) are not available in runtime. In this scenario user receives error message, briefly explaining what's going on.Use case examples: