0

I have a p12 format client ssl certificates.

How can I configure it in Netty in SslContextBuilder class?

Mr.Wang from Next Door
  • 13,670
  • 12
  • 64
  • 97

1 Answers1

2

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:

  • javax.net.ssl.keyStore
  • javax.net.ssl.keyStorePassword

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));
Community
  • 1
  • 1
Leo Gomes
  • 1,113
  • 9
  • 14