[ 
https://issues.apache.org/jira/browse/KNOX-2267?focusedWorklogId=400291&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-400291
 ]

ASF GitHub Bot logged work on KNOX-2267:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 09/Mar/20 18:35
            Start Date: 09/Mar/20 18:35
    Worklog Time Spent: 10m 
      Work Description: smolnar82 commented on pull request #283: KNOX-2267 - 
Ambari/CM discovery - Needs to point to configured truststore
URL: https://github.com/apache/knox/pull/283#discussion_r389884272
 
 

 ##########
 File path: 
gateway-spi/src/main/java/org/apache/knox/gateway/util/TruststoreSSLContextUtils.java
 ##########
 @@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations 
under
+ * the License.
+ */
+package org.apache.knox.gateway.util;
+
+import org.apache.http.ssl.SSLContextBuilder;
+import org.apache.http.ssl.SSLContexts;
+import org.apache.knox.gateway.i18n.GatewaySpiMessages;
+import org.apache.knox.gateway.i18n.messages.MessagesFactory;
+import org.apache.knox.gateway.services.security.KeystoreService;
+import org.apache.knox.gateway.services.security.KeystoreServiceException;
+
+import javax.net.ssl.SSLContext;
+import java.security.KeyManagementException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+
+public class TruststoreSSLContextUtils {
+  private static final GatewaySpiMessages LOGGER = 
MessagesFactory.get(GatewaySpiMessages.class);
+
+  private TruststoreSSLContextUtils() {
+  }
+
+  public static SSLContext getTruststoreSSLContext(KeystoreService 
keystoreService) {
+    SSLContext sslContext = null;
+    try {
+      SSLContextBuilder sslContextBuilder = SSLContexts.custom();
 
 Review comment:
   nit: I'd create this instance only if it's really needed (`keystoreService 
!= null && truststore != null`)
 
----------------------------------------------------------------
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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 400291)
    Time Spent: 20m  (was: 10m)

> Ambari/CM discovery - Needs to point to configured truststore
> -------------------------------------------------------------
>
>                 Key: KNOX-2267
>                 URL: https://issues.apache.org/jira/browse/KNOX-2267
>             Project: Apache Knox
>          Issue Type: Bug
>          Components: cm-discovery
>            Reporter: Kevin Risden
>            Assignee: Kevin Risden
>            Priority: Major
>             Fix For: 1.4.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Currently Ambari and CM discovery uses internal HTTP clients. We need to 
> ensure that the Ambari and CM clients are configured with the Knox configured 
> HTTP client truststore.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to