use of org.apache.camel.util.jsse.SSLContextParameters in project camel by apache.
the class SslContextParametersInUriCometdProducerConsumerTest method createRegistry.
@Override
protected JndiRegistry createRegistry() throws Exception {
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource("jsse/localhost.ks");
ksp.setPassword("changeit");
KeyManagersParameters kmp = new KeyManagersParameters();
kmp.setKeyPassword("changeit");
kmp.setKeyStore(ksp);
TrustManagersParameters tmp = new TrustManagersParameters();
tmp.setKeyStore(ksp);
SSLContextParameters sslContextParameters = new SSLContextParameters();
sslContextParameters.setKeyManagers(kmp);
sslContextParameters.setTrustManagers(tmp);
JndiRegistry registry = super.createRegistry();
registry.bind("sslContextParameters", sslContextParameters);
return registry;
}
use of org.apache.camel.util.jsse.SSLContextParameters in project wildfly-camel by wildfly-extras.
the class AhcWSSIntegrationTest method defineSSLContextClientParameters.
private static SSLContextParameters defineSSLContextClientParameters() {
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource("/" + KEYSTORE);
ksp.setPassword(KEYSTORE_PASSWORD);
KeyManagersParameters kmp = new KeyManagersParameters();
kmp.setKeyPassword(KEYSTORE_PASSWORD);
kmp.setKeyStore(ksp);
TrustManagersParameters tmp = new TrustManagersParameters();
tmp.setKeyStore(ksp);
SSLContextParameters scp = new SSLContextParameters();
scp.setKeyManagers(kmp);
scp.setTrustManagers(tmp);
return scp;
}
use of org.apache.camel.util.jsse.SSLContextParameters in project wildfly-camel by wildfly-extras.
the class CXFWSSecureConsumerIntegrationTest method createSSLContextParameters.
private SSLContextParameters createSSLContextParameters() {
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource(System.getProperty("jboss.server.config.dir") + "/application.keystore");
ksp.setPassword("password");
KeyManagersParameters kmp = new KeyManagersParameters();
kmp.setKeyStore(ksp);
kmp.setKeyPassword("password");
SSLContextClientParameters sslContextClientParameters = new SSLContextClientParameters();
SSLContextParameters sslContextParameters = new SSLContextParameters();
sslContextParameters.setClientParameters(sslContextClientParameters);
sslContextParameters.setKeyManagers(kmp);
TrustManagersParameters tmp = new TrustManagersParameters();
tmp.setKeyStore(ksp);
sslContextParameters.setTrustManagers(tmp);
return sslContextParameters;
}
use of org.apache.camel.util.jsse.SSLContextParameters in project camel by apache.
the class WebsocketSSLContextInUriRouteExampleTest method createRegistry.
@Override
protected JndiRegistry createRegistry() throws Exception {
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource("jsse/localhost.ks");
ksp.setPassword(pwd);
KeyManagersParameters kmp = new KeyManagersParameters();
kmp.setKeyPassword(pwd);
kmp.setKeyStore(ksp);
TrustManagersParameters tmp = new TrustManagersParameters();
tmp.setKeyStore(ksp);
// NOTE: Needed since the client uses a loose trust configuration when no ssl context
// is provided. We turn on WANT client-auth to prefer using authentication
SSLContextServerParameters scsp = new SSLContextServerParameters();
SSLContextParameters sslContextParameters = new SSLContextParameters();
sslContextParameters.setKeyManagers(kmp);
sslContextParameters.setTrustManagers(tmp);
sslContextParameters.setServerParameters(scsp);
JndiRegistry registry = super.createRegistry();
registry.bind("sslContextParameters", sslContextParameters);
return registry;
}
use of org.apache.camel.util.jsse.SSLContextParameters in project camel by apache.
the class WebsocketSSLRouteExampleTest method defineSSLContextParameters.
protected SSLContextParameters defineSSLContextParameters() {
KeyStoreParameters ksp = new KeyStoreParameters();
// ksp.setResource(this.getClass().getClassLoader().getResource("jsse/localhost.ks").toString());
ksp.setResource("jsse/localhost.ks");
ksp.setPassword(pwd);
KeyManagersParameters kmp = new KeyManagersParameters();
kmp.setKeyPassword(pwd);
kmp.setKeyStore(ksp);
TrustManagersParameters tmp = new TrustManagersParameters();
tmp.setKeyStore(ksp);
// NOTE: Needed since the client uses a loose trust configuration when no ssl context
// is provided. We turn on WANT client-auth to prefer using authentication
SSLContextServerParameters scsp = new SSLContextServerParameters();
SSLContextParameters sslContextParameters = new SSLContextParameters();
sslContextParameters.setKeyManagers(kmp);
sslContextParameters.setTrustManagers(tmp);
sslContextParameters.setServerParameters(scsp);
return sslContextParameters;
}
Aggregations