Skip to content

Instantly share code, notes, and snippets.

@Glamdring
Created August 19, 2021 06:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Glamdring/2fb9d723ef8ea229c39742e94e477135 to your computer and use it in GitHub Desktop.
Save Glamdring/2fb9d723ef8ea229c39742e94e477135 to your computer and use it in GitHub Desktop.
package com.yourcomany.util.net;
import org.springframework.integration.ip.tcp.connection.DefaultTcpNioSSLConnectionSupport;
import org.springframework.integration.ip.tcp.connection.TcpSSLContextSupport;
import javax.net.ssl.SSLEngine;
/**
* NIO Connection support for optional TLS Mutual authentication
*/
public class TLSMutualNioConnectionSupport extends DefaultTcpNioSSLConnectionSupport {
public TLSMutualNioConnectionSupport(TcpSSLContextSupport sslContextSupport) {
super(sslContextSupport);
}
public TLSMutualNioConnectionSupport(TcpSSLContextSupport sslContextSupport, boolean sslVerifyHost) {
super(sslContextSupport, sslVerifyHost);
}
@Override
protected void postProcessSSLEngine(SSLEngine sslEngine) {
sslEngine.setWantClientAuth(true);
super.postProcessSSLEngine(sslEngine);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment