bcuff / elasticsearch-net-aws

Add-on to Elasticsearch.Net & NEST for using AWS's elasticsearch service.
Apache License 2.0
72 stars 27 forks source link

Started receiving 403 for a specific application with message about request signature #47

Closed george-weare8 closed 5 years ago

george-weare8 commented 5 years ago

Hi, I am using ELasticsearch.Net.Aws version 6.1.0 and AWS Elasticsearch service 6.7.

Using the nuget package was working fine for an EC2 instance I have on AWS but then out of nowhere it just stopped with the below error for all requests.

Status: 403
      {"message":"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details."}

I can use VPN to access my Elasticsearch anonymously if I want and when I am on VPN using normal HttpConnection everything works fine. Any ideas? How can I help with more information?

bcuff commented 5 years ago

This fix was introduced in 7.0.0. Can you tell if the client is emitting a User-Agent header and if it's part of the signature?

If this is indeed the problem, you could 1) Update to 7.0.0. This might not work for you since you're using ES 6.7. 2) Fork/cherry-pick this or I could publish a separate package for 6.x that was the fix in it.

george-weare8 commented 5 years ago

I have found the problem. .NET Core was picking up by mistake version 6.8.1 of NEST which signing will not work but working with 6.8.0, I originally was using 6.7.0 which is the right thing to do so reverting and fixing the project referenced package version worked.

bcuff commented 5 years ago

Ah okay. Good to know. Thanks for reporting.