I have a client certificate .pem file including private key and certificate. I want to use Feign to call the restful api which requires client certificate.
I googled a lot of examples but those examples teach that import keys from jks like below:
public class App {
public static void main(String[] args) throws Exception {
SSLFactory sslFactory = SSLFactory.builder()
.withIdentityMaterial("identity.jks", "password".toCharArray())
.withTrustMaterial("truststore.jks", "password".toCharArray())
.build();
Feign.Builder client = Feign.builder()
.client(new Client.Default(sslFactory.getSslSocketFactory(), sslFactory.getHostnameVerifier()));
}
}
However, I want to import the cert from .pem file directly because I don't have .jks file and don't want convert it by manual because the .pem file is fetched programmatically periodically from other servers. How can I do that?