Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A604C17839 for ; Fri, 24 Oct 2014 21:42:58 +0000 (UTC) Received: (qmail 96668 invoked by uid 500); 24 Oct 2014 21:42:58 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 96521 invoked by uid 500); 24 Oct 2014 21:42:58 -0000 Mailing-List: contact commits-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list commits@camel.apache.org Received: (qmail 96503 invoked by uid 99); 24 Oct 2014 21:42:58 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Oct 2014 21:42:58 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 34C2F812670; Fri, 24 Oct 2014 21:42:58 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dhirajsb@apache.org To: commits@camel.apache.org Date: Fri, 24 Oct 2014 21:43:01 -0000 Message-Id: <5f7d0949c12f471082a8d71e1fa3b0d1@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [4/5] git commit: CAMEL-7955: Updated Camel-linkedin to use SSLContextParameters to configure HtmlUnit for OAuth CAMEL-7955: Updated Camel-linkedin to use SSLContextParameters to configure HtmlUnit for OAuth Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/18e08c2e Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/18e08c2e Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/18e08c2e Branch: refs/heads/camel-2.14.x Commit: 18e08c2e0079c564c72f5141a8a9a3b845f3f1b0 Parents: bfa2388 Author: Dhiraj Bokde Authored: Fri Oct 24 13:27:09 2014 -0700 Committer: Dhiraj Bokde Committed: Fri Oct 24 14:42:28 2014 -0700 ---------------------------------------------------------------------- .../linkedin/api/LinkedInOAuthRequestFilter.java | 4 +++- .../api/AbstractResourceIntegrationTest.java | 4 ++-- .../component/linkedin/LinkedInComponent.java | 18 +++++++++++++++++- 3 files changed, 22 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/18e08c2e/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java ---------------------------------------------------------------------- diff --git a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java b/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java index 4fd7194..ed11944 100644 --- a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java +++ b/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java @@ -47,6 +47,7 @@ import com.gargoylesoftware.htmlunit.html.HtmlPage; import com.gargoylesoftware.htmlunit.html.HtmlPasswordInput; import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput; import com.gargoylesoftware.htmlunit.html.HtmlTextInput; + import org.apache.http.HttpHost; import org.apache.http.HttpStatus; import org.apache.http.conn.params.ConnRoutePNames; @@ -82,7 +83,7 @@ public final class LinkedInOAuthRequestFilter implements ClientRequestFilter { @SuppressWarnings("deprecation") public LinkedInOAuthRequestFilter(OAuthParams oAuthParams, Map httpParams, - boolean lazyAuth) { + boolean lazyAuth, String[] enabledProtocols) { this.oAuthParams = oAuthParams; this.oAuthToken = null; @@ -95,6 +96,7 @@ public final class LinkedInOAuthRequestFilter implements ClientRequestFilter { options.setThrowExceptionOnFailingStatusCode(true); options.setThrowExceptionOnScriptError(true); options.setPrintContentOnFailingStatusCode(LOG.isDebugEnabled()); + options.setSSLClientProtocols(enabledProtocols); // add HTTP proxy if set if (httpParams != null && httpParams.get(ConnRoutePNames.DEFAULT_PROXY) != null) { http://git-wip-us.apache.org/repos/asf/camel/blob/18e08c2e/components/camel-linkedin/camel-linkedin-api/src/test/java/org/apache/camel/component/linkedin/api/AbstractResourceIntegrationTest.java ---------------------------------------------------------------------- diff --git a/components/camel-linkedin/camel-linkedin-api/src/test/java/org/apache/camel/component/linkedin/api/AbstractResourceIntegrationTest.java b/components/camel-linkedin/camel-linkedin-api/src/test/java/org/apache/camel/component/linkedin/api/AbstractResourceIntegrationTest.java index d8f474e..b0f3ad8 100644 --- a/components/camel-linkedin/camel-linkedin-api/src/test/java/org/apache/camel/component/linkedin/api/AbstractResourceIntegrationTest.java +++ b/components/camel-linkedin/camel-linkedin-api/src/test/java/org/apache/camel/component/linkedin/api/AbstractResourceIntegrationTest.java @@ -48,7 +48,7 @@ public class AbstractResourceIntegrationTest extends Assert { @BeforeClass public static void beforeClass() throws Exception { properties = new Properties(); - properties.load(PeopleResourceIntegrationTest.class.getResourceAsStream("/test-options.properties")); + properties.load(AbstractResourceIntegrationTest.class.getResourceAsStream("/test-options.properties")); requestFilter = createOAuthHelper(); } @@ -82,7 +82,7 @@ public class AbstractResourceIntegrationTest extends Assert { final OAuthParams oAuthParams = new OAuthParams(userName, userPassword, secureStorage, clientId, clientSecret, redirectUri, scopes); - return new LinkedInOAuthRequestFilter(oAuthParams, null, false); + return new LinkedInOAuthRequestFilter(oAuthParams, null, false, null); } @AfterClass http://git-wip-us.apache.org/repos/asf/camel/blob/18e08c2e/components/camel-linkedin/camel-linkedin-component/src/main/java/org/apache/camel/component/linkedin/LinkedInComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-linkedin/camel-linkedin-component/src/main/java/org/apache/camel/component/linkedin/LinkedInComponent.java b/components/camel-linkedin/camel-linkedin-component/src/main/java/org/apache/camel/component/linkedin/LinkedInComponent.java index 4434f8c..a45a300 100644 --- a/components/camel-linkedin/camel-linkedin-component/src/main/java/org/apache/camel/component/linkedin/LinkedInComponent.java +++ b/components/camel-linkedin/camel-linkedin-component/src/main/java/org/apache/camel/component/linkedin/LinkedInComponent.java @@ -16,6 +16,10 @@ */ package org.apache.camel.component.linkedin; +import java.io.IOException; +import java.security.GeneralSecurityException; +import javax.net.ssl.SSLContext; + import org.apache.camel.CamelContext; import org.apache.camel.Endpoint; import org.apache.camel.component.linkedin.api.LinkedInOAuthRequestFilter; @@ -24,7 +28,9 @@ import org.apache.camel.component.linkedin.internal.CachingOAuthSecureStorage; import org.apache.camel.component.linkedin.internal.LinkedInApiCollection; import org.apache.camel.component.linkedin.internal.LinkedInApiName; import org.apache.camel.spi.UriEndpoint; +import org.apache.camel.util.ObjectHelper; import org.apache.camel.util.component.AbstractApiComponent; +import org.apache.camel.util.jsse.SSLContextParameters; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -72,8 +78,18 @@ public class LinkedInComponent extends AbstractApiComponent