Reputation: 14820
I have a p12 format client ssl certificates.
How can I configure it in Netty in SslContextBuilder class?
Upvotes: 0
Views: 2678
Reputation: 1153
Convert the .p12 to a Java Keystore.
When starting your application, make sure you set the following system properties with the path to your Java Keystore (.jks) and given password:
Then, you can create a default SSLContext as shown below and add it to Netty's pipeline:
SSLContext ctx = SSLContext.getDefault();
SSLEngine engine = ctx.createSSLEngine();
engine.setUseClientMode(true);
pipeline.addLast("sslHandler", new SslHandler(engine));
Upvotes: 2