In one of my apps I'm using HTTPS with a self-signed certificate and followed the sample code from the android developer training site (https://developer.android.com/training/articles/security-ssl.html#UnknownCa).
I recently got the following alert saying that the current implementation is not secured:
Security alert
Your app is using an unsafe implementation of the X509TrustManager interface with an Apache HTTP client, resulting in a security vulnerability. Please see this Google Help Center article for details, including the deadline for fixing the vulnerability.
Can someone provide more details on what should be updated beyond the sample code linked above?
Should I implement a custom TrustManager
? If so, what should it verify?
TrustManager
? How are you using it? – CovenanteeThe second case of SSLHandshakeException is due to a self-signed certificate, which means the server is behaving as its own CA. This is similar to an unknown certificate authority, so you can use the same approach from the previous section.
– PolystyreneTrustManager
but I'm not sure if that is sufficient. blog.fordemobile.com/2012/04/https-requests-on-android.html (Look atEasyX509TrustManager
implementation) – Polystyreneimplements X509TrustManager
in your code anywhere, perhaps it is coming from a library in your project, rather than your own code. Are you using any libraries that use Internet access (e.g., ad networks)? – Covenantee