Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Async client is missing ssl_assert_hostname implementation #842

Closed
merlinz01 opened this issue Nov 10, 2024 · 0 comments · Fixed by #843
Closed

[BUG] Async client is missing ssl_assert_hostname implementation #842

merlinz01 opened this issue Nov 10, 2024 · 0 comments · Fixed by #843
Labels
bug Something isn't working

Comments

@merlinz01
Copy link
Contributor

What is the bug?

The ssl_assert_hostname parameter has no effect on the AsyncOpenSearch client.

How can one reproduce the bug?

client = AsyncOpenSearch(hosts='my.opensearch.with.selfsigned.certs', ssl_assert_hostname=False)
await client.search(...)
opensearchpy.exceptions.ConnectionError: ConnectionError(Cannot connect to host my.opensearch.instance:9200 ssl:True [SSLCertVerificationError: (1, "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'my.opensearch.instance'. (_ssl.c:1000)")]) caused by: ClientConnectorCertificateError(Cannot connect to host my.opensearch.instance:9200 ssl:True [SSLCertVerificationError: (1, "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'my.opensearch.instance'. (_ssl.c:1000)")])

What is the expected behavior?

The connection should succeed even if the hostname does not match.

What is your host/environment?

N/A

Do you have any screenshots?

N/A

Do you have any additional context?

The parameter is documented in the function docs:

:arg ssl_assert_hostname: use hostname verification if not `False`

I believe the parameter works with the urllib3-based client.

I'm working on a PR to fix this.

@merlinz01 merlinz01 added bug Something isn't working untriaged Need triage labels Nov 10, 2024
@dblock dblock removed the untriaged Need triage label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants