Search code examples
androidandroid-download-manager

DownloadManager how to replace HttpClient?


I have Android 4.1.2 device. I'm trying to download file from HTTPS and get error about not valid certificate.

Ok, I created custom TrustManager, which skips this error.

How to specify, that DownloadManager used my HttpClient whith custom TrustManager?


Solution

  • Implementing a custom "Dummy-TrustManager" is a simple but dumb idea as it destroys the security of SSL/TLS.

    What you need instead is to trust that specific certificate of the server, not every (self-signed) certificate in the world!

    There is a complete blog topic by Nikolay Elenkov which explains everything you need, including code samples: Using a Custom Certificate Trust Store on Android