use of org.apache.camel.util.jsse.SSLContextParameters in project camel by apache.
the class LumberjackComponentSSLTest method createServerSSLContextParameters.
/**
* Creates the {@link SSLContextParameters} Camel object for the Lumberjack component
*
* @return The {@link SSLContextParameters} Camel object for the Lumberjack component
*/
private SSLContextParameters createServerSSLContextParameters() {
SSLContextParameters sslContextParameters = new SSLContextParameters();
KeyManagersParameters keyManagersParameters = new KeyManagersParameters();
KeyStoreParameters keyStore = new KeyStoreParameters();
keyStore.setPassword("changeit");
keyStore.setResource("org/apache/camel/component/lumberjack/keystore.jks");
keyManagersParameters.setKeyPassword("changeit");
keyManagersParameters.setKeyStore(keyStore);
sslContextParameters.setKeyManagers(keyManagersParameters);
return sslContextParameters;
}
use of org.apache.camel.util.jsse.SSLContextParameters in project camel by apache.
the class LinkedInComponent method createRequestFilter.
private LinkedInOAuthRequestFilter createRequestFilter(LinkedInConfiguration configuration) {
// validate configuration
configuration.validate();
final String[] enabledProtocols;
try {
// use default SSP to create supported non-SSL protocols list
final SSLContext sslContext = new SSLContextParameters().createSSLContext(getCamelContext());
enabledProtocols = sslContext.createSSLEngine().getEnabledProtocols();
} catch (GeneralSecurityException e) {
throw ObjectHelper.wrapRuntimeCamelException(e);
} catch (IOException e) {
throw ObjectHelper.wrapRuntimeCamelException(e);
}
return new LinkedInOAuthRequestFilter(getOAuthParams(configuration), configuration.getHttpParams(), configuration.isLazyAuth(), enabledProtocols);
}
use of org.apache.camel.util.jsse.SSLContextParameters in project wildfly-camel by wildfly-extras.
the class ApnsUtils method clientContext.
public static SSLContextParameters clientContext() throws Exception {
final KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource(ApnsUtils.class.getResource("/" + FixedCertificates.CLIENT_STORE).toString());
ksp.setType("PKCS12");
final KeyManagersParameters kmp = new KeyManagersParameters();
kmp.setKeyStore(ksp);
kmp.setKeyPassword(FixedCertificates.CLIENT_PASSWORD);
kmp.setAlgorithm(getAlgorithm());
final SSLContextParameters contextParameters = new SSLContextParameters();
contextParameters.setKeyManagers(kmp);
contextParameters.setTrustManagers(new TrustManagersParameters() {
@Override
public TrustManager[] createTrustManagers() throws GeneralSecurityException, IOException {
return new TrustManager[] { new X509TrustManager() {
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
}
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
}
public X509Certificate[] getAcceptedIssuers() {
return new X509Certificate[0];
}
} };
}
});
return contextParameters;
}
use of org.apache.camel.util.jsse.SSLContextParameters in project wildfly-camel by wildfly-extras.
the class SecureNettyIntegrationTest method setUp.
@Before
public void setUp() throws Exception {
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);
InitialContext context = new InitialContext();
context.bind("sslContextParameters", scp);
}
Aggregations