Reputation: 1617
I am using DownloadManager to download a file from a https server in my android app. As I'm still in the development phase, I would like to trust all hosts and avoid certificate checks. How can I tell DownloadManager to trust all hosts?
For further development, how can I add a certificate to trust a certain host with DownloadManager?
Thank you.
Upvotes: 4
Views: 3725
Reputation: 5752
On Android Nougat and newer you can use the declarative Network Security Config to make the app trust a particular leaf or CA certificate used by that server -- see https://developer.android.com/training/articles/security-config.html#ConfigCustom for an example. Download Manager will trust that certificate for HTTPS requests on behalf of your app as well.
Upvotes: 2