janhoy commented on code in PR #1284:
URL: https://github.com/apache/solr/pull/1284#discussion_r1066374442
##########
solr/modules/jwt-auth/src/java/org/apache/solr/security/jwt/JWTAuthPlugin.java:
##########
@@ -297,6 +283,54 @@ public void init(Map<String, Object> pluginConfig) {
lastInitTime = Instant.now();
}
+ /**
+ * Given a configuration object of a file name or list of file names, read
X509 certificates from
+ * each file
+ */
+ @SuppressWarnings("unchecked")
+ Collection<X509Certificate> readSslCertsFromFileOrList(Object
trustedCertsFileObj) {
+ Collection<X509Certificate> certs = new HashSet<>();
+ if (trustedCertsFileObj instanceof String) {
+ String trustedCertsFile = (String) trustedCertsFileObj;
+ log.info("Reading trustedCerts from file {}", trustedCertsFile);
+ try {
+ certs.addAll(parseCertsFromFile(trustedCertsFile));
+ } catch (IOException e) {
+ throw new SolrException(
+ SolrException.ErrorCode.SERVER_ERROR, "Failed to read file " +
trustedCertsFile, e);
+ }
Review Comment:
I had the same thought on the train home from work today :) Will investigate.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]