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

Attempt to load the new letsencrypt x1 and x2 certs. #250

Merged
merged 3 commits into from
Aug 28, 2024

Conversation

notandyvee
Copy link
Collaborator

@notandyvee notandyvee commented Aug 28, 2024

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.

  1. We need to store the new certificates in our app.
  2. We need to apply this new certificate when making network calls.

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

@notandyvee notandyvee added the Bug label Aug 28, 2024
@notandyvee
Copy link
Collaborator Author

@danilo04 if you have bandwidth. Happiness is waiting for a fix to communicate to users.

Copy link
Contributor

@roundhill roundhill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM and I confirmed this fixed the issue on Android 6 and 7 devices running Simplenote.

@notandyvee notandyvee merged commit e3651fd into trunk Aug 28, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants