You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2017/05/29 18:24:54 UTC

httpcomponents-client git commit: CredSSP scheme to throw SSLInitializationException in case of SSL context initialization failure instead of untyped RuntimeException

Repository: httpcomponents-client
Updated Branches:
  refs/heads/master a034a34db -> 1cba813bf


CredSSP scheme to throw SSLInitializationException in case of SSL context initialization failure instead of untyped RuntimeException


Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/commit/1cba813b
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/tree/1cba813b
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-client/diff/1cba813b

Branch: refs/heads/master
Commit: 1cba813bf892cdab5e6564f11d1ca4561d639237
Parents: a034a34
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Mon May 29 20:17:36 2017 +0200
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Mon May 29 20:21:57 2017 +0200

----------------------------------------------------------------------
 .../org/apache/hc/client5/http/impl/auth/CredSspScheme.java     | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-client/blob/1cba813b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/CredSspScheme.java
----------------------------------------------------------------------
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/CredSspScheme.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/CredSspScheme.java
index 461f818..5c8403d 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/CredSspScheme.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/CredSspScheme.java
@@ -64,6 +64,7 @@ import org.apache.hc.core5.http.HttpHost;
 import org.apache.hc.core5.http.HttpRequest;
 import org.apache.hc.core5.http.protocol.HttpContext;
 import org.apache.hc.core5.ssl.SSLContexts;
+import org.apache.hc.core5.ssl.SSLInitializationException;
 import org.apache.hc.core5.util.Args;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
@@ -173,7 +174,7 @@ public class CredSspScheme implements AuthScheme
         }
         catch ( NoSuchAlgorithmException | KeyManagementException e )
         {
-            throw new RuntimeException( "Error creating SSL Context: " + e.getMessage(), e );
+            throw new SSLInitializationException( "Error creating SSL Context: " + e.getMessage(), e );
         }
 
         final X509TrustManager tm = new X509TrustManager()
@@ -211,7 +212,7 @@ public class CredSspScheme implements AuthScheme
         }
         catch ( final KeyManagementException e )
         {
-            throw new RuntimeException( "SSL Context initialization error: " + e.getMessage(), e );
+            throw new SSLInitializationException( "SSL Context initialization error: " + e.getMessage(), e );
         }
         final SSLEngine sslEngine = sslContext.createSSLEngine();
         sslEngine.setUseClientMode( true );