zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ivmaykov <...@git.apache.org>
Subject [GitHub] zookeeper pull request #678: ZOOKEEPER-3173: Quorum TLS - support PEM trust/...
Date Mon, 29 Oct 2018 16:57:15 GMT
Github user ivmaykov commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/678#discussion_r229012448
  
    --- Diff: zookeeper-server/src/main/java/org/apache/zookeeper/common/X509Util.java ---
    @@ -360,4 +476,26 @@ private void configureSSLServerSocket(SSLServerSocket sslServerSocket)
{
             LOG.debug("Using Java8-optimized cipher suites for Java version {}", javaVersion);
             return DEFAULT_CIPHERS_JAVA8;
         }
    +
    +    /**
    +     * Detects the type of KeyStore / TrustStore file from the file extension. If the
file name ends with
    +     * ".jks", returns <code>StoreFileType.JKS</code>. If the file name ends
with ".pem", returns
    +     * <code>StoreFileType.PEM</code>. Otherwise, throws an IOException.
    +     * @param filename the filename of the key store or trust store file.
    +     * @return a StoreFileType.
    +     * @throws IOException if the filename does not end with ".jks" or ".pem".
    +     */
    +    public static StoreFileType detectStoreFileTypeFromFileExtension(File filename) throws
IOException {
    --- End diff --
    
    How about I make it package-private and add a unit test?


---

Mime
View raw message