本文整理汇总了Java中org.apache.camel.util.jsse.SSLContextParameters类的典型用法代码示例。如果您正苦于以下问题:Java SSLContextParameters类的具体用法?Java SSLContextParameters怎么用?Java SSLContextParameters使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SSLContextParameters类属于org.apache.camel.util.jsse包,在下文中一共展示了SSLContextParameters类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testRetry
import org.apache.camel.util.jsse.SSLContextParameters; //导入依赖的package包/类
@Test
public void testRetry() throws Exception {
SalesforceComponent sf = context().getComponent("salesforce", SalesforceComponent.class);
String accessToken = sf.getSession().getAccessToken();
SslContextFactory sslContextFactory = new SslContextFactory();
sslContextFactory.setSslContext(new SSLContextParameters().createSSLContext(context));
HttpClient httpClient = new HttpClient(sslContextFactory);
httpClient.setConnectTimeout(60000);
httpClient.start();
String uri = sf.getLoginConfig().getLoginUrl() + "/services/oauth2/revoke?token=" + accessToken;
Request logoutGet = httpClient.newRequest(uri)
.method(HttpMethod.GET)
.timeout(1, TimeUnit.MINUTES);
ContentResponse response = logoutGet.send();
assertEquals(HttpStatus.OK_200, response.getStatus());
JobInfo jobInfo = new JobInfo();
jobInfo.setOperation(OperationEnum.INSERT);
jobInfo.setContentType(ContentType.CSV);
jobInfo.setObject(Merchandise__c.class.getSimpleName());
createJob(jobInfo);
}
开发者ID:HydAu,项目名称:Camel,代码行数:26,代码来源:BulkApiIntegrationTest.java
示例2: sslParameters
import org.apache.camel.util.jsse.SSLContextParameters; //导入依赖的package包/类
/**
*
* @return certificate paramters for tls
* @throws GeneralSecurityException
* @throws IOException
*/
public static SSLContextParameters sslParameters() throws GeneralSecurityException, IOException {
String storePath = System.getProperty(ServerProperties.KEYSTORE);
String alias = System.getProperty(ServerProperties.ALIAS);
String pass = System.getProperty(ServerProperties.PASS);
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource(storePath);
ksp.setPassword(pass);
KeyManagersParameters kmp = new KeyManagersParameters();
kmp.setKeyStore(ksp);
kmp.setKeyPassword(pass);
TrustManagersParameters tmp = new TrustManagersParameters();
tmp.setKeyStore(ksp);
SSLContextParameters scp = new SSLContextParameters();
scp.setKeyManagers(kmp);
scp.setTrustManagers(tmp);
return scp;
}
开发者ID:IIlllII,项目名称:bitbreeds-webrtc,代码行数:28,代码来源:SimpleSignalingExample.java
示例3: createCxfProducerEndpoint
import org.apache.camel.util.jsse.SSLContextParameters; //导入依赖的package包/类
@Named("cxfProducerEndpoint")
@Produces
public CxfEndpoint createCxfProducerEndpoint() {
CxfComponent cxfProducerComponent = new CxfComponent(this.camelContext);
CxfEndpoint cxfProducerEndpoint = new CxfEndpoint(CXF_PRODUCER_ENDPOINT_ADDRESS, cxfProducerComponent);
cxfProducerEndpoint.setBeanId("cxfProducerEndpoint");
cxfProducerEndpoint.setServiceClass(org.wildfly.camel.examples.cxf.jaxws.GreetingService.class);
SSLContextParameters producerSslContextParameters = this.createProducerSSLContextParameters();
cxfProducerEndpoint.setSslContextParameters(producerSslContextParameters);
// Not for use in production
HostnameVerifier hostnameVerifier = new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
return true;
}
};
cxfProducerEndpoint.setHostnameVerifier(hostnameVerifier);
return cxfProducerEndpoint;
}
开发者ID:wildfly-extras,项目名称:wildfly-camel-examples,代码行数:23,代码来源:Application.java
示例4: createConsumerSSLContextParameters
import org.apache.camel.util.jsse.SSLContextParameters; //导入依赖的package包/类
private SSLContextParameters createConsumerSSLContextParameters() {
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource(KEYSTORE_PATH);
ksp.setPassword(KEYSTORE_PASSWORD);
TrustManagersParameters tmp = new TrustManagersParameters();
tmp.setKeyStore(ksp);
SSLContextServerParameters sslContextServerParameters = new SSLContextServerParameters();
sslContextServerParameters.setClientAuthentication(ClientAuthentication.REQUIRE.name());
SSLContextParameters sslContextParameters = new SSLContextParameters();
sslContextParameters.setServerParameters(sslContextServerParameters);
sslContextParameters.setTrustManagers(tmp);
KeyManagersParameters kmp = new KeyManagersParameters();
kmp.setKeyStore(ksp);
kmp.setKeyPassword(KEYSTORE_PASSWORD);
sslContextParameters.setKeyManagers(kmp);
return sslContextParameters;
}
开发者ID:wildfly-extras,项目名称:wildfly-camel-examples,代码行数:22,代码来源:Application.java
示例5: createRegistry
import org.apache.camel.util.jsse.SSLContextParameters; //导入依赖的package包/类
@Override
protected JndiRegistry createRegistry() throws Exception {
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource("server.jks");
ksp.setPassword("password");
KeyManagersParameters kmp = new KeyManagersParameters();
kmp.setKeyPassword("password");
kmp.setKeyStore(ksp);
TrustManagersParameters tmp = new TrustManagersParameters();
tmp.setKeyStore(ksp);
SSLContextParameters sslContextParameters = new SSLContextParameters();
sslContextParameters.setSecureSocketProtocol("SSL");
sslContextParameters.setKeyManagers(kmp);
sslContextParameters.setTrustManagers(tmp);
JndiRegistry registry = super.createRegistry();
registry.bind("sslContextParameters", sslContextParameters);
return registry;
}
开发者ID:HydAu,项目名称:Camel,代码行数:23,代码来源:FileToFtpsImplicitSSLWithClientAuthAndSSLContextParametersTest.java
示例6: createRegistry
import org.apache.camel.util.jsse.SSLContextParameters; //导入依赖的package包/类
@Override
protected JndiRegistry createRegistry() throws Exception {
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource("server.jks");
ksp.setPassword("password");
TrustManagersParameters tmp = new TrustManagersParameters();
tmp.setKeyStore(ksp);
SSLContextParameters sslContextParameters = new SSLContextParameters();
sslContextParameters.setSecureSocketProtocol("SSL");
sslContextParameters.setTrustManagers(tmp);
JndiRegistry registry = super.createRegistry();
registry.bind("sslContextParameters", sslContextParameters);
return registry;
}
开发者ID:HydAu,项目名称:Camel,代码行数:18,代码来源:FileToFtpsExplicitSSLWithoutClientAuthAndSSLContextParametersTest.java
示例7: createRegistry
import org.apache.camel.util.jsse.SSLContextParameters; //导入依赖的package包/类
@Override
protected JndiRegistry createRegistry() throws Exception {
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource("server.jks");
ksp.setPassword("password");
TrustManagersParameters tmp = new TrustManagersParameters();
tmp.setKeyStore(ksp);
SSLContextParameters sslContextParameters = new SSLContextParameters();
sslContextParameters.setSecureSocketProtocol("TLS");
sslContextParameters.setTrustManagers(tmp);
JndiRegistry registry = super.createRegistry();
registry.bind("sslContextParameters", sslContextParameters);
return registry;
}
开发者ID:HydAu,项目名称:Camel,代码行数:18,代码来源:FileToFtpsExplicitTLSWithoutClientAuthAndSSLContextParametersTest.java
示例8: createRegistry
import org.apache.camel.util.jsse.SSLContextParameters; //导入依赖的package包/类
@Override
protected JndiRegistry createRegistry() throws Exception {
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource("server.jks");
ksp.setPassword("password");
KeyManagersParameters kmp = new KeyManagersParameters();
kmp.setKeyPassword("password");
kmp.setKeyStore(ksp);
TrustManagersParameters tmp = new TrustManagersParameters();
tmp.setKeyStore(ksp);
SSLContextParameters sslContextParameters = new SSLContextParameters();
sslContextParameters.setSecureSocketProtocol("TLS");
sslContextParameters.setKeyManagers(kmp);
sslContextParameters.setTrustManagers(tmp);
JndiRegistry registry = super.createRegistry();
registry.bind("sslContextParameters", sslContextParameters);
return registry;
}
开发者ID:HydAu,项目名称:Camel,代码行数:23,代码来源:FileToFtpsImplicitTLSWithClientAuthAndSSLContextParametersTest.java
示例9: createSslSocketConnector
import org.apache.camel.util.jsse.SSLContextParameters; //导入依赖的package包/类
private Connector createSslSocketConnector(CamelContext context, int port) throws Exception {
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource(this.getClass().getClassLoader().getResource("jsse/localhost.ks").toString());
ksp.setPassword(pwd);
KeyManagersParameters kmp = new KeyManagersParameters();
kmp.setKeyPassword(pwd);
kmp.setKeyStore(ksp);
SSLContextParameters sslContextParameters = new SSLContextParameters();
sslContextParameters.setKeyManagers(kmp);
// From Camel 2.5.0 Camel-Jetty is using SslSelectChannelConnector instead of SslSocketConnector
//SslSelectChannelConnector sslSocketConnector = new SslSelectChannelConnector();
//sslSocketConnector.getSslContextFactory().setSslContext(sslContextParameters.createSSLContext());
//sslSocketConnector.setPort(port);
//return sslSocketConnector;
return null;
}
开发者ID:HydAu,项目名称:Camel,代码行数:21,代码来源:ExplicitHttpsSslContextParametersRouteTest.java
示例10: createRegistry
import org.apache.camel.util.jsse.SSLContextParameters; //导入依赖的package包/类
@Override
protected JndiRegistry createRegistry() throws Exception {
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource("localhost.ks");
ksp.setPassword("changeit");
TrustManagersParameters tmp = new TrustManagersParameters();
tmp.setKeyStore(ksp);
SSLContextParameters sslContextParameters = new SSLContextParameters();
sslContextParameters.setTrustManagers(tmp);
JndiRegistry registry = super.createRegistry();
registry.bind("sslContextParameters", sslContextParameters);
return registry;
}
开发者ID:HydAu,项目名称:Camel,代码行数:19,代码来源:IrcsWithSslContextParamsRouteTest.java
示例11: defineSSLContextParameters
import org.apache.camel.util.jsse.SSLContextParameters; //导入依赖的package包/类
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;
}
开发者ID:HydAu,项目名称:Camel,代码行数:26,代码来源:WebsocketSSLRouteExampleTest.java
示例12: createMojo
import org.apache.camel.util.jsse.SSLContextParameters; //导入依赖的package包/类
@Override
protected CamelSalesforceMojo createMojo() throws IOException {
final CamelSalesforceMojo mojo = super.createMojo();
// SSL context parameters
mojo.sslContextParameters = new SSLContextParameters();
// HTTP proxy properties
mojo.httpProxyHost = HTTP_PROXY_HOST;
mojo.httpProxyPort = httpProxyPort;
mojo.httpProxyUsername = HTTP_PROXY_USER_NAME;
mojo.httpProxyPassword = HTTP_PROXY_PASSWORD;
mojo.httpProxyRealm = HTTP_PROXY_REALM;
mojo.httpProxyAuthUri = String.format("https://%s:%s", HTTP_PROXY_HOST, httpProxyPort);
// HTTP client properties
mojo.httpClientProperties = new HashMap<String, Object>();
mojo.httpClientProperties.put("timeout", "60000");
mojo.httpClientProperties.put("removeIdleDestinations", "true");
return mojo;
}
开发者ID:HydAu,项目名称:Camel,代码行数:23,代码来源:HttpProxyMojoIntegrationTest.java
示例13: createRegistry
import org.apache.camel.util.jsse.SSLContextParameters; //导入依赖的package包/类
@Override
protected JndiRegistry createRegistry() throws Exception {
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource(this.getClass().getClassLoader().getResource("jsse/localhost.ks").getPath().toString());
ksp.setPassword("changeit");
KeyManagersParameters kmp = new KeyManagersParameters();
kmp.setKeyPassword("changeit");
kmp.setKeyStore(ksp);
SSLContextParameters sslContextParameters = new SSLContextParameters();
sslContextParameters.setKeyManagers(kmp);
JndiRegistry registry = super.createRegistry();
registry.bind("mySSLContextParameters", sslContextParameters);
return registry;
}
开发者ID:HydAu,项目名称:Camel,代码行数:19,代码来源:RestletHttpsWithSSLContextParametersTest.java
示例14: addSslContextParametersToRegistry
import org.apache.camel.util.jsse.SSLContextParameters; //导入依赖的package包/类
protected void addSslContextParametersToRegistry(JndiRegistry registry) {
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource(this.getClass().getClassLoader().getResource("jsse/localhost.ks").toString());
ksp.setPassword(KEY_STORE_PASSWORD);
KeyManagersParameters kmp = new KeyManagersParameters();
kmp.setKeyPassword(KEY_STORE_PASSWORD);
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);
registry.bind("sslContextParameters", sslContextParameters);
}
开发者ID:HydAu,项目名称:Camel,代码行数:25,代码来源:BaseMina2Test.java
示例15: defineSSLContextServerParameters
import org.apache.camel.util.jsse.SSLContextParameters; //导入依赖的package包/类
private static SSLContextParameters defineSSLContextServerParameters() {
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource("jsse/localhost.ks");
ksp.setPassword(PW);
KeyManagersParameters kmp = new KeyManagersParameters();
kmp.setKeyPassword(PW);
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);
return sslContextParameters;
}
开发者ID:HydAu,项目名称:Camel,代码行数:26,代码来源:WssProducerTest.java
示例16: createRouteBuilder
import org.apache.camel.util.jsse.SSLContextParameters; //导入依赖的package包/类
@Override
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() {
SSLContextParameters params = new SSLContextParameters();
ProtocolSocketFactory factory =
new SSLContextParametersSecureProtocolSocketFactory(params, context);
Protocol.registerProtocol("https",
new Protocol(
"https",
factory,
443));
from("direct:start")
.to("https://mail.google.com/mail/").to("mock:results");
}
};
}
开发者ID:HydAu,项目名称:Camel,代码行数:21,代码来源:HttpsSslContextParametersGetTest.java
示例17: createSslContextParameters
import org.apache.camel.util.jsse.SSLContextParameters; //导入依赖的package包/类
public static SSLContextParameters createSslContextParameters() {
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource(MailTestHelper.class.getClassLoader().getResource("jsse/localhost.ks").toString());
ksp.setPassword(KEY_STORE_PASSWORD);
KeyManagersParameters kmp = new KeyManagersParameters();
kmp.setKeyPassword(KEY_STORE_PASSWORD);
kmp.setKeyStore(ksp);
TrustManagersParameters tmp = new TrustManagersParameters();
tmp.setKeyStore(ksp);
SSLContextParameters sslContextParameters = new SSLContextParameters();
sslContextParameters.setKeyManagers(kmp);
sslContextParameters.setTrustManagers(tmp);
return sslContextParameters;
}
开发者ID:HydAu,项目名称:Camel,代码行数:19,代码来源:MailTestHelper.java
示例18: getSSLContextParameters
import org.apache.camel.util.jsse.SSLContextParameters; //导入依赖的package包/类
private SSLContextParameters getSSLContextParameters(String path, String password) {
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource(path);
ksp.setPassword(password);
KeyManagersParameters kmp = new KeyManagersParameters();
kmp.setKeyPassword(password);
kmp.setKeyStore(ksp);
TrustManagersParameters tmp = new TrustManagersParameters();
tmp.setKeyStore(ksp);
SSLContextParameters sslContextParameters = new SSLContextParameters();
sslContextParameters.setKeyManagers(kmp);
sslContextParameters.setTrustManagers(tmp);
return sslContextParameters;
}
开发者ID:HydAu,项目名称:Camel,代码行数:19,代码来源:StompBaseTest.java
示例19: createRegistry
import org.apache.camel.util.jsse.SSLContextParameters; //导入依赖的package包/类
@Override
protected JndiRegistry createRegistry() throws Exception {
KeyStoreParameters ksp = new KeyStoreParameters();
ksp.setResource(this.getClass().getClassLoader().getResource("jsse/localhost.ks").toString());
ksp.setPassword(pwd);
KeyManagersParameters kmp = new KeyManagersParameters();
kmp.setKeyPassword(pwd);
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;
}
开发者ID:HydAu,项目名称:Camel,代码行数:23,代码来源:JettyHttpsProducerSslContextInUriTest.java
示例20: createSslContextFactory
import org.apache.camel.util.jsse.SSLContextParameters; //导入依赖的package包/类
private SslContextFactory createSslContextFactory(SSLContextParameters ssl) throws GeneralSecurityException, IOException {
SslContextFactory answer = new SslContextFactory();
if (ssl != null) {
answer.setSslContext(ssl.createSSLContext());
}
return answer;
}
开发者ID:nkasvosve,项目名称:beyondj,代码行数:8,代码来源:JettyHttpComponent.java
注:本文中的org.apache.camel.util.jsse.SSLContextParameters类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论