0
   try {
                    String urlImage="https://maps.googleapis.com/maps/api/staticmap?center=0,0&zoom=1&size=100x100&key=AIzaSyD_GK1iiZD2kV5J_v6";
                    System.out.println(urlImage);
                    bitmap1 = BitmapFactory.decodeStream((InputStream) new URL(urlImage).getContent());




                } catch (Exception e) {
                    e.printStackTrace();
                }

when i call this url i get

javax.net.ssl.sslhandshakeexception:Handshake failed 

exception how can i solve it

Muhammed Fasil
  • 7,909
  • 2
  • 19
  • 28

1 Answers1

1

Based from this related SO post, you need to obtain the public certificate from the server you're trying to connect to. Try contacting the server admin and asking for it, using openssl to download it, or, since this appears to be an HTTP server, connecting to it with any browser, viewing the page's security info, and saving a copy of the certificate. As stated also in this documentation, this can happen for several reasons, including:

You can check the documentation which discussed how to address these problems while keeping your connection to the server secure.

Community
  • 1
  • 1
abielita
  • 13,147
  • 2
  • 17
  • 59