# Snapshot to S3 via corporate proxy

**URL:** <https://discuss.elastic.co/t/snapshot-to-s3-via-corporate-proxy/36431>\
**Category:** Elasticsearch\
**Created:** [December 5, 2015, 6:47am UTC](https://discuss.elastic.co/t/snapshot-to-s3-via-corporate-proxy/36431 "2015-12-05T06:47:47Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![gromit](https://avatars.discourse-cdn.com/v4/letter/g/ac8455/32.png) [@gromit](https://discuss.elastic.co/u/gromit)\
**Post date:** [December 5, 2015, 6:47am UTC](https://discuss.elastic.co/t/snapshot-to-s3-via-corporate-proxy/36431/1 "2015-12-05T06:47:48Z")

</div>

I would like to use an S3 repository for snapshots, but access is via a corporate HTTP proxy that requires authentication.  
Currently I'm using a shared file system repository and then using proxychains with S3cmd to send the snapshot to AWS.  
Is there some way I can configure Elasticsearch to use the proxy so I can send directly?  
I see there is a proxy uri option, but I don't see any option for authentication.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 5, 2015, 7:35am UTC](https://discuss.elastic.co/t/snapshot-to-s3-via-corporate-proxy/36431/2 "2015-12-05T07:35:17Z")

</div>

You can try something similar to [https://www.elastic.co/guide/en/elasticsearch/plugins/current/\_other\_command\_line\_parameters.html#\_proxy\_settings](https://www.elastic.co/guide/en/elasticsearch/plugins/current/_other_command_line_parameters.html#_proxy_settings)

You can try setting http.proxyUser and http.proxyPassword.

But I'm unsure if S3 SDK will use that.

Can you test this?

Also, can you open an issue in elasticsearch project with your findings?

So we can either:

- fix it by code if S3 SDK has this option
- document it if it's only a parameter fix

Thanks!

---

<div class="post-metadata">

**Author:** ![gromit](https://avatars.discourse-cdn.com/v4/letter/g/ac8455/32.png) [@gromit](https://discuss.elastic.co/u/gromit)\
**Post date:** [December 5, 2015, 7:58am UTC](https://discuss.elastic.co/t/snapshot-to-s3-via-corporate-proxy/36431/3 "2015-12-05T07:58:02Z")

</div>

Thanks, I tried http.proxyUser and http.proxyPassword to try a plugin install but this returned 'unknown' for http.proxyUser.  
So the command line was 'sudo bin/plugin install mobz/elasticsearch-head -DproxyHost=host\_name -DproxyPort=port\_number http.proxyUser=username http.proxyPassword=password'  
Also tried -http.proxyUser and -Dhttp.proxyUser  
Currently using ES 1.44  
I'll open an issue in elasticsearch project as you recommended.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 5, 2015, 8:16am UTC](https://discuss.elastic.co/t/snapshot-to-s3-via-corporate-proxy/36431/4 "2015-12-05T08:16:57Z")

</div>

You need to pass that within JAVA\_OPTS IIRC.

---

<div class="post-metadata">

**Author:** ![gromit](https://avatars.discourse-cdn.com/v4/letter/g/ac8455/32.png) [@gromit](https://discuss.elastic.co/u/gromit)\
**Post date:** [December 5, 2015, 11:35pm UTC](https://discuss.elastic.co/t/snapshot-to-s3-via-corporate-proxy/36431/5 "2015-12-05T23:35:02Z")

</div>

As the cluster takes around 40 mins to rebalance after restarting elasticsearch can I just confirm the following settings?

Editing /bin/elasticsearch.in.sh, I tried the following but still could not install a plugin, failed to connect (/bin/plugin install mobz/elasticsearch-head -DproxyHost=192.168.0.1 -DproxyPort=8080)

# Set Proxy

JAVA\_OPTS="$JAVA\_OPTS -Dhttp.proxyUser=username"  
JAVA\_OPTS="$JAVA\_OPTS -Dhttp.proxyPassword=password"

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 6, 2015, 3:33am UTC](https://discuss.elastic.co/t/snapshot-to-s3-via-corporate-proxy/36431/6 "2015-12-06T03:33:29Z")

</div>

I think you should add also http.proxyHost and http.proxyPort to JAVA\_OPTS

Can you test that on a test cluster so it will be harmless?

---

<div class="post-metadata">

**Author:** ![gromit](https://avatars.discourse-cdn.com/v4/letter/g/ac8455/32.png) [@gromit](https://discuss.elastic.co/u/gromit)\
**Post date:** [December 6, 2015, 5:44am UTC](https://discuss.elastic.co/t/snapshot-to-s3-via-corporate-proxy/36431/7 "2015-12-06T05:44:54Z")

</div>

Plugins install OK now with your recommendations.

Unfortunately a PUT S3 repository request returns the following error:

Service: Amazon S3; Status Code: 407; Error Code: 407 Proxy Authentication Required.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 6, 2015, 7:13am UTC](https://discuss.elastic.co/t/snapshot-to-s3-via-corporate-proxy/36431/8 "2015-12-06T07:13:24Z")

</div>

Can you open an issue and link to this thread?

---

<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:** [July 5, 2017, 11:33pm UTC](https://discuss.elastic.co/t/snapshot-to-s3-via-corporate-proxy/36431/9 "2017-07-05T23:33:18Z")

</div>


