# Faild to connect spark-elasticsearch with keystore location as hdfs

**URL:** https://discuss.elastic.co/t/faild-to-connect-spark-elasticsearch-with-keystore-location-as-hdfs/217880
**Category:** Elasticsearch
**Created:** [February 4, 2020, 9:49pm UTC](https://discuss.elastic.co/t/faild-to-connect-spark-elasticsearch-with-keystore-location-as-hdfs/217880 "2020-02-04T21:49:30Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![maniarch](https://avatars.discourse-cdn.com/v4/letter/m/edb3f5/32.png) [@maniarch](https://discuss.elastic.co/u/maniarch)
#### Post date: [February 4, 2020, 9:49pm UTC](https://discuss.elastic.co/t/faild-to-connect-spark-elasticsearch-with-keystore-location-as-hdfs/217880/1 "2020-02-04T21:49:31Z")

</div>

Hi ,

I'm running my spark job against a secured elasticsearch cluster.  
I have trustore.jks and keystore.jks generated , if i run run my spark job with ,jks on local path they are working fine but if i put my jks files in hdfs and read those files from hdfs i'm getting below exception:  
Caused by: org.elasticsearch.hadoop.EsHadoopIllegalArgumentException: Expected to find keystore file at [file:///keystore.jks] but was unable to. Make sure that it is available on the classpath, or if not, that you have specified a valid URI.

i would like to know how to use below two parameters if the files location is hdfs:  
spark.es.net.ssl.truststore.location  
spark.es.net.ssl.keystore.location

Thanks in Advance!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [March 3, 2020, 9:49pm UTC](https://discuss.elastic.co/t/faild-to-connect-spark-elasticsearch-with-keystore-location-as-hdfs/217880/2 "2020-03-03T21:49:34Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
