title: PKIX path building failed when getting data from URL
body: <p>I am trying to get data as follows (indicated thus by the API):</p>
  
  <pre><code>HttpResponse&lt;String&gt; response = Unirest.get("https://opendata.aemet.es/opendata/api/valores/climatologicos/diarios/datos/fechaini/2017-08-16T00:00:00UTC/fechafin/2017-08-17T23:59:59UTC/estacion/2422/?api_key=eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJqb3NoZXJAY2FydGlmLmVzIiwianRpIjoiZWM3MDkxMzItNTE0ZC00OGZjLTljMjMtYTBiMzVjNTllYzdjIiwiZXhwIjoxNTEwNzMxMzU4LCJpc3MiOiJBRU1FVCIsImlhdCI6MTUwMjk1NTM1OCwidXNlcklkIjoiZWM3MDkxMzItNTE0ZC00OGZjLTljMjMtYTBiMzVjNTllYzdjIiwicm9sZSI6IiJ9.WSVaE3C9TFMMa8x1mUvHpt1-n3Cgy3p7r2DaflSm9VU")
                .header("cache-control", "no-cache")
                .asString();
  </code></pre>
  
  <p>Nevertheless, when I execute the code, an exception is thrown:</p>
  
  <pre><code>Exception in thread "main" com.mashape.unirest.http.exceptions.UnirestException: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      at com.mashape.unirest.http.HttpClientHelper.request(HttpClientHelper.java:143)
      at com.mashape.unirest.request.BaseRequest.asString(BaseRequest.java:56)
      at eu.cartif.meteo.Weather_Meteo.main(Weather_Meteo.java:38)
  Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      at sun.security.ssl.Alerts.getSSLException(Unknown Source)
      at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
      at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
      at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
      at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
      at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
      at sun.security.ssl.Handshaker.processLoop(Unknown Source)
      at sun.security.ssl.Handshaker.process_record(Unknown Source)
      at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
      at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
      at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
      at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
      at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:396)
      at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:355)
      at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
      at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:359)
      at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
      at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
      at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
      at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
      at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
      at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
      at com.mashape.unirest.http.HttpClientHelper.request(HttpClientHelper.java:138)
  ... 2 more
  Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
      at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
      at sun.security.validator.Validator.validate(Unknown Source)
      at sun.security.ssl.X509TrustManagerImpl.validate(Unknown Source)
      at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
      at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
  ... 24 more
  Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      at sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
      at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
      at java.security.cert.CertPathBuilder.build(Unknown Source)
  ... 30 more    
  </code></pre>
  
  <p>I have also tried to import the certificate by means of the keytool, but I get a message saying "The file keystore does not exist".</p>
  
  <p>May someone support me? Thanks in advance</p>