Closed matthewdeanmartin closed 6 months ago
Hello @matthewdeanmartin, I feel this is related to PR.
urllib3 documentation:
We typically use ssl_assert_hostname when the server presents a certificate different from the hostname or the SNI hostname. here
It can be set to values like False, None, or an actual hostname. here
By default, assert_hostname is set to server_hostname. here
Documentation on using different hosts with distinct parameters can be found here.
If I've missed anything, please share the code used to create the client. Thank you.
I wish I was setting ssl_assert_hostname because I could fix that. opensearchpy code is setting that value.
Specifying the connection_class is the last interaction I have with Urllib3HttpConnection.
def client(self) -> opensearchpy.OpenSearch:
kwargs = {
"verify_certs": True,
# connection_class=opensearchpy.RequestsHttpConnection,
# only use for request4auth
"connection_class": opensearchpy.Urllib3HttpConnection,
"timeout": self.elastic_search_timeout,
"retry_on_timeout": True,
"ssl_show_warn": True,
}
return opensearchpy.OpenSearch([self.elastic_search_url_parts], **kwargs)
Nevermind, found the issue. The params of OpenSearch are passed to the connection_class and I had some copy-paste from doucmentation that set the ssl_assert_hostname instead of verify_certs.
I guess this is the cost of using an untyped language.
The bulk insert (opensearchpy.helpers.parallel_bulk) functionality fails on a cryptic error message from urllib3
This is running on python 3.12, AWS Linux 2023, urllib3==1.26.18, opensearch-py==2.4.2 when attempting to load large quantities of data. I'm going to try to see if the requests library has the same problem.
The internet has no useful suggestions on what is wrong.