How to fix unsafe implementation of X509TrustManager as advised by Google

Google has advised that I have an unsafe implementation of the interface X509TrustManager in my Android application and need to change the code as follows:

"To properly handle SSL certificate validation, change your code in the checkServerTrusted method of your custom X509TrustManager interface to raise either CertificateException or IllegalArgumentException whenever the certificate presented by the server does not meet your expectations.

The task is to modify the following code to meet the requirement mentioned above:

public EasySSLSocketFactory(KeyStore truststore) throws NoSuchAlgorithmException, KeyManagementException, KeyStoreException, UnrecoverableKeyException {


TrustManager tm = new X509TrustManager() {

public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {


public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {


public X509Certificate[] getAcceptedIssuers() {

return null;



[login to view URL](null, new TrustManager[] { tm }, null);


Habilidades: Android, Java, Mobile App Development

Veja mais: super android 17, how to string, how to fix my, android keystore, css google chrome table fix, google maps implementation jobs, google chrome gif fix, google maps implementation php, google chrome image fix, google checkout implementation, google map api fix problem, google chrome css fix, google calendar implementation api, google map api fix

Acerca do Empregador:
( 62 comentários ) London, United Kingdom

ID do Projeto: #9714398

5 freelancers estão ofertando em média $51 para esse trabalho


Hi, I have 4+ years of experience in app development. I have successfully launched 36+ apps on Google Play Store. I have working experience on both Eclipse and android studio. I am especially master in Java. Have be Mais

$55 USD em 1 dia
(127 Comentários)
$50 USD em 1 dia
(74 Comentários)

Hello, I have completed the same project: [login to view URL]~014eea79f0615253b8/ (Update Android App for SSL) skype: StanislavKo28 Take a look at my apps: ""Freelance site"" . https://play.g Mais

$50 USD in 2 dias
(21 Comentários)

Hi, I am an experienced java proffessional expert in core java j2ee spring mvc hibernate orm webservices. I can do this. Pls contact fro further progress.

$50 USD in 2 dias
(43 Comentários)

10+ years Java programming experience. I work with X509 client and server certificates in a daily basis.

$50 USD in 3 dias
(0 Comentários)