Attempt to load the new letsencrypt x1 and x2 certs. #250
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.
What
This PR fixes an SSL issue,
Error: javax.net.ssl.SSLHandshakeException
. Many users on Android 6 and 7 for simplenote cannot login. Michal did a great investigation on this here. Digging into the the reasoning, more info can be found here.A quick TL;DR of what happened is, most clients come with pre-installed trusted certificates for SSL. People on older devices, Android 7 and earlier for example, do not have the updated list of trusted certificates. Letsencrypt wants to stop relying on cross-signed certificates, thus they ended support for it. But this means any clients without these new self-signed certificates will start having ssl issues.
The Fix
The fix is two parts.
For the certificates part, you can get them directly on letsencrypt.com. They are added in the raw resources directory directly as PEM files.
For the network calls this was a bit tricker. Originally I was going to use a similar process that Michal used with the
network_security_configuration.xml
file. This is the simplest and most straightforward approach. But I ran into a problem. We support a min SDK of 23. Security configuration file support wasn't added until SDK 24 😢 . Sadly we have to load the certificates manually. So it made sense to programmatically do this for Android APIs < 25. Meaning both Android 6 and 7.Test