steveloughran commented on a change in pull request #970: HADOOP-16371: Option 
to disable GCM for SSL connections when running on Java 8
URL: https://github.com/apache/hadoop/pull/970#discussion_r325091341
 
 

 ##########
 File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ssl/DelegatingSSLSocketFactory.java
 ##########
 @@ -118,33 +144,47 @@ private SSLSocketFactoryEx(SSLChannelMode 
preferredChannelMode)
   private void initializeSSLContext(SSLChannelMode preferredChannelMode)
       throws NoSuchAlgorithmException, KeyManagementException {
     switch (preferredChannelMode) {
-      case Default:
-        try {
-          java.util.logging.Logger logger = 
java.util.logging.Logger.getLogger(SSL.class.getName());
-          logger.setLevel(Level.WARNING);
-          ctx = SSLContext.getInstance("openssl.TLS");
-          ctx.init(null, null, null);
-          // Strong reference needs to be kept to logger until initialization 
of SSLContext finished (see HADOOP-16174):
-          logger.setLevel(Level.INFO);
-          channelMode = SSLChannelMode.OpenSSL;
-        } catch (NoSuchAlgorithmException e) {
-          LOG.warn("Failed to load OpenSSL. Falling back to the JSSE 
default.");
-          ctx = SSLContext.getDefault();
-          channelMode = SSLChannelMode.Default_JSSE;
-        }
-        break;
-      case OpenSSL:
+    case Default:
+      if (!openSSLProviderRegistered) {
+        OpenSSLProvider.register();
 
 Review comment:
   Thanks.
   
   I always had the belief that integers and other simple constants may just 
get compiled in but that the class load Will kick off as soon as you reference 
a string in class. I should do more experiments. Maybe even learn Java assembly 
language. Anyway, as long as we don't try referencing, things like strings from 
the class, we should be okay. And as the little wild fly JAR is not currently 
on the hadoop-aws test CP, we are implicitly verifying this. We probably have 
to be careful once we had more support for it -we need to make sure we've not 
accidentally made it mandatory.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to