0

I need to use the .pem certificates to access the database but I think I am not doing well. Putting .toString () doesn't seem very correct.

I currently have the certificates in the "assets" folder.

Do I have to convert the .PEM certificates to another type of certificates with another extension?

        props.setProperty("sslrootcert",mContext.getAssets().open("ca-cert.pem").toString());
        props.setProperty("sslkey",mContext.getAssets().open("client-key.pem").toString());
        props.setProperty("sslcert",mContext.getAssets().open("client-cert.pem").toString());
Albert
  • 11
  • 4
  • check this, on how to read the files from assets folder https://stackoverflow.com/a/9544781/8035260 – jose praveen Mar 18 '20 at 11:29
  • Thanks for answering. I already tried to do it using InputStream and buffer and it was not a solution. I think it has to do more with something that needs to be done to .pem certificates – Albert Mar 18 '20 at 11:49
  • do you have problem in reading .pem file? @albert – jose praveen Mar 18 '20 at 11:52
  • I think so, because the SSL connection does not work in my program and after many tests the only possibility is that I am not reading the .pem certificates well. I have read that maybe I have to transform them to another file, for example with extension .jks but I am not sure about this. – Albert Mar 18 '20 at 11:58

0 Answers0