public void validateMutualTLS()

in cassandra-analytics-core/src/main/java/org/apache/cassandra/secrets/SslConfigSecretsProvider.java [136:177]


    public void validateMutualTLS()
    {
        boolean fail = false;

        String keyStorePath = config.keyStorePath();
        if (keyStorePath != null)
        {
            if (!Files.exists(Paths.get(keyStorePath)))
            {
                LOGGER.warn("Provided keystore path option does not exist in the file system keystorePath={}", keyStorePath);
                fail = true;
            }
        }
        else if (config.base64EncodedKeyStore() == null || config.base64EncodedKeyStore().isEmpty())
        {
            LOGGER.warn("Neither keystore path or encoded keystore options were provided");
            fail = true;
        }

        if (keyStorePassword() == null)
        {
            LOGGER.warn("No keystore password option provided");
        }

        String trustStorePath = config.trustStorePath();
        if (trustStorePath != null && !Files.exists(Paths.get(trustStorePath)))
        {
            LOGGER.warn("Provided truststore path option does not exist in the file system trustStorePath={}", trustStorePath);
            fail = true;
        }

        if ((trustStorePath != null || config.base64EncodedTrustStore() != null) && trustStorePassword() == null)
        {
            LOGGER.warn("No truststore password option provided");
            fail = true;
        }

        if (fail)
        {
            throw new RuntimeException("No valid keystore/password provided in options");
        }
    }