cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amccri...@apache.org
Subject [cxf] branch master updated: Put setSSLSocketFactory in a doPriv
Date Mon, 04 Jun 2018 21:09:42 GMT
This is an automated email from the ASF dual-hosted git repository.

amccright pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git


The following commit(s) were added to refs/heads/master by this push:
     new d1d9d72  Put setSSLSocketFactory in a doPriv
d1d9d72 is described below

commit d1d9d721f91e4574c6ae87628c6050825d94760a
Author: Andy McCright <j.andrew.mccright@gmail.com>
AuthorDate: Mon Jun 4 15:28:17 2018 -0500

    Put setSSLSocketFactory in a doPriv
---
 .../apache/cxf/transport/https/HttpsURLConnectionFactory.java  | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/https/HttpsURLConnectionFactory.java
b/rt/transports/http/src/main/java/org/apache/cxf/transport/https/HttpsURLConnectionFactory.java
index 057e687..cced865 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/https/HttpsURLConnectionFactory.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/https/HttpsURLConnectionFactory.java
@@ -26,7 +26,9 @@ import java.lang.reflect.Method;
 import java.net.HttpURLConnection;
 import java.net.Proxy;
 import java.net.URL;
+import java.security.AccessController;
 import java.security.GeneralSecurityException;
+import java.security.PrivilegedAction;
 import java.util.logging.Handler;
 import java.util.logging.Logger;
 
@@ -168,7 +170,13 @@ public class HttpsURLConnectionFactory {
             // handle the expected case (javax.net.ssl)
             HttpsURLConnection conn = (HttpsURLConnection) connection;
             conn.setHostnameVerifier(verifier);
-            conn.setSSLSocketFactory(socketFactory);
+            AccessController.doPrivileged(new PrivilegedAction<Void>() {
+
+                @Override
+                public Void run() {
+                    conn.setSSLSocketFactory(socketFactory);
+                    return null;
+                } });
         } else {
             // handle the deprecated sun case and other possible hidden API's
             // that are similar to the Sun cases

-- 
To stop receiving notification emails like this one, please contact
amccright@apache.org.

Mime
View raw message