code: public static KeyStore loadCacertsKeyStore(String provider) {
          File file = new File(System.getProperty("java.home"), "lib");
          file = new File(file, "security");
          file = new File(file, "cacerts");
          FileInputStream fin = null;
          try {
              fin = new FileInputStream(file);
              KeyStore k;
              if (provider == null)
                  k = KeyStore.getInstance("JKS");
              else
                  k = KeyStore.getInstance("JKS", provider);
              k.load(fin, null);
              return k;
          }
          catch (Exception e) {
              throw new ExceptionConverter(e);
          }
          finally {
              try{if (fin != null) {fin.close();}}catch(Exception ex){}
          }
      }
docs: Loads the default root certificates at &lt;java.home&gt;/lib/security/cacerts.
  @param provider the provider or <code>null</code> for the default provider
  @return a <CODE>KeyStore</CODE>