Java Code Examples for org.apache.camel.support.jsse.SSLContextParameters#setClientParameters()
The following examples show how to use
org.apache.camel.support.jsse.SSLContextParameters#setClientParameters() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Application.java From wildfly-camel-examples with Apache License 2.0 | 6 votes |
private SSLContextParameters createProducerSSLContextParameters() { final KeyStoreParameters ksp = new KeyStoreParameters(); ksp.setResource(CLIENT_CERT_KEYSTORE_PATH); ksp.setPassword(CLIENT_CERT_KEYSTORE_PASSWORD); final KeyManagersParameters kmp = new KeyManagersParameters(); kmp.setKeyStore(ksp); kmp.setKeyPassword(CLIENT_CERT_KEYSTORE_PASSWORD); final SSLContextClientParameters sslContextClientParameters = new SSLContextClientParameters(); final SSLContextParameters sslContextParameters = new SSLContextParameters(); sslContextParameters.setClientParameters(sslContextClientParameters); sslContextParameters.setKeyManagers(kmp); sslContextParameters.setCertAlias("client"); sslContextParameters.setSecureSocketProtocol("TLSv1.2"); // so that the client trusts the self-signed server certificate final KeyStoreParameters trustStoreParams = new KeyStoreParameters(); trustStoreParams.setResource(CLIENT_CERT_TRUSTSTORE_PATH); trustStoreParams.setPassword(CLIENT_CERT_KEYSTORE_PASSWORD); final TrustManagersParameters tmp = new TrustManagersParameters(); tmp.setKeyStore(trustStoreParams); sslContextParameters.setTrustManagers(tmp); return sslContextParameters; }
Example 2
Source File: CXFWSSecureConsumerIntegrationTest.java From wildfly-camel with Apache License 2.0 | 6 votes |
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; }