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

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.