private SslSocketHelper() {
}
public static SSLSocket createSSLSocket(String certDistinguishedName, boolean wantAuth, boolean needAuth)
throws IOException {
JMXPrincipal principal = new JMXPrincipal(certDistinguishedName);
X509Certificate cert = new StubX509Certificate(principal);
StubSSLSession sslSession = new StubSSLSession(cert);
StubSSLSocket sslSocket = new StubSSLSocket(sslSession);
sslSocket.setWantClientAuth(wantAuth);