Search in sources :

Example 6 with SSLContextServerParameters

use of org.apache.camel.util.jsse.SSLContextServerParameters 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;
}
Also used : KeyManagersParameters(org.apache.camel.util.jsse.KeyManagersParameters) TrustManagersParameters(org.apache.camel.util.jsse.TrustManagersParameters) KeyStoreParameters(org.apache.camel.util.jsse.KeyStoreParameters) SSLContextServerParameters(org.apache.camel.util.jsse.SSLContextServerParameters) SSLContextParameters(org.apache.camel.util.jsse.SSLContextParameters)

Example 7 with SSLContextServerParameters

use of org.apache.camel.util.jsse.SSLContextServerParameters in project camel by apache.

the class NettySSLContextParametersTest method createRegistry.

@Override
protected JndiRegistry createRegistry() throws Exception {
    KeyStoreParameters ksp = new KeyStoreParameters();
    ksp.setResource(this.getClass().getClassLoader().getResource("keystore.jks").toString());
    ksp.setPassword("changeit");
    KeyManagersParameters kmp = new KeyManagersParameters();
    kmp.setKeyPassword("changeit");
    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();
    scsp.setClientAuthentication(ClientAuthentication.WANT.name());
    SSLContextParameters sslContextParameters = new SSLContextParameters();
    sslContextParameters.setKeyManagers(kmp);
    sslContextParameters.setTrustManagers(tmp);
    sslContextParameters.setServerParameters(scsp);
    JndiRegistry registry = super.createRegistry();
    registry.bind("sslContextParameters", sslContextParameters);
    return registry;
}
Also used : KeyManagersParameters(org.apache.camel.util.jsse.KeyManagersParameters) JndiRegistry(org.apache.camel.impl.JndiRegistry) TrustManagersParameters(org.apache.camel.util.jsse.TrustManagersParameters) KeyStoreParameters(org.apache.camel.util.jsse.KeyStoreParameters) SSLContextServerParameters(org.apache.camel.util.jsse.SSLContextServerParameters) SSLContextParameters(org.apache.camel.util.jsse.SSLContextParameters)

Example 8 with SSLContextServerParameters

use of org.apache.camel.util.jsse.SSLContextServerParameters in project camel by apache.

the class AbstractSSLContextServerParametersFactoryBean method createInstance.

@Override
protected SSLContextServerParameters createInstance() {
    SSLContextServerParameters newInstance = new SSLContextServerParameters();
    newInstance.setClientAuthentication(clientAuthentication);
    newInstance.setCamelContext(getCamelContext());
    return newInstance;
}
Also used : SSLContextServerParameters(org.apache.camel.util.jsse.SSLContextServerParameters)

Aggregations

SSLContextServerParameters (org.apache.camel.util.jsse.SSLContextServerParameters)8 KeyManagersParameters (org.apache.camel.util.jsse.KeyManagersParameters)7 KeyStoreParameters (org.apache.camel.util.jsse.KeyStoreParameters)7 SSLContextParameters (org.apache.camel.util.jsse.SSLContextParameters)7 TrustManagersParameters (org.apache.camel.util.jsse.TrustManagersParameters)7 JndiRegistry (org.apache.camel.impl.JndiRegistry)3