/** * Add SSL files to distributed cache. Trust store, key store and ssl config xml * * @param job - Job handle * @param sslConfigPath - ssl Configuration file specified through options * @throws IOException - If any */ private void addSSLFilesToDistCache(Job job, Path sslConfigPath) throws IOException { Configuration configuration = job.getConfiguration(); FileSystem localFS = FileSystem.getLocal(configuration); Configuration sslConf = new Configuration(false); sslConf.addResource(sslConfigPath); Path localStorePath = getLocalStorePath(sslConf, DistCpConstants.CONF_LABEL_SSL_TRUST_STORE_LOCATION); job.addCacheFile(localStorePath.makeQualified(localFS.getUri(), localFS.getWorkingDirectory()).toUri()); configuration.set(DistCpConstants.CONF_LABEL_SSL_TRUST_STORE_LOCATION, localStorePath.getName()); localStorePath = getLocalStorePath(sslConf, DistCpConstants.CONF_LABEL_SSL_KEY_STORE_LOCATION); job.addCacheFile(localStorePath.makeQualified(localFS.getUri(), localFS.getWorkingDirectory()).toUri()); configuration.set(DistCpConstants.CONF_LABEL_SSL_KEY_STORE_LOCATION, localStorePath.getName()); job.addCacheFile(sslConfigPath.makeQualified(localFS.getUri(), localFS.getWorkingDirectory()).toUri()); }