smolnar82 commented on code in PR #981:
URL: https://github.com/apache/knox/pull/981#discussion_r1923923518


##########
gateway-service-metadata/src/main/java/org/apache/knox/gateway/service/metadata/KnoxMetadataResource.java:
##########
@@ -169,32 +164,31 @@ private Response 
generateFailureFileDownloadResponse(Status status, String error
     return responseBuilder.build();
   }
 
-  private Certificate getPublicCertificate(GatewayServices gatewayServices, 
GatewayConfig config) {
+  private Certificate[] getPublicCertificates() {
     try {
-      final KeystoreService keystoreService = 
gatewayServices.getService(ServiceType.KEYSTORE_SERVICE);
-      return 
keystoreService.getKeystoreForGateway().getCertificate(config.getIdentityKeyAlias());
-    } catch (KeyStoreException | KeystoreServiceException e) {
+      return 
X509CertificateUtil.fetchPublicCertsFromServer(request.getRequestURL().toString(),
 true, null);

Review Comment:
   @pzampino - I didn't find this utility method 
(`X509CertificateUtil.fetchPublicCertsFromServer`) on the master branch. I 
assume this was left of the commit. 
   I recall I implemented something similar to KnoxShell 
[here](https://github.com/apache/knox/blob/master/gateway-shell/src/main/java/org/apache/knox/gateway/shell/KnoxSh.java#L208-L231).



-- 
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.

To unsubscribe, e-mail: dev-unsubscr...@knox.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to