NAME
OpenSearch::Client::Cxn::HTTPTiny - A Cxn implementation which uses HTTP::Tiny
VERSION
version 3.007002
DESCRIPTION
Provides the default HTTP Cxn class and is based on HTTP::Tiny. The HTTP::Tiny backend is fast, uses pure Perl, support proxies and https and provides persistent connections.
This class does OpenSearch::Client::Role::Cxn, whose documentation provides more information, and OpenSearch::Client::Role::Is_Sync.
CONFIGURATION
Inherited configuration
From OpenSearch::Client::Role::Cxn
SSL/TLS
OpenSearch::Client::Cxn::HTTPTiny uses IO::Socket::SSL to support HTTPS. By default, full verification of the remote host certificate is performed.
If the remote server cannot be verified, an OpenSearch::Client::Error will be thrown.
This behaviour can be changed by passing the ssl_options parameter with any options passed through to IO::Socket::SSL by HTTP::Tiny.
For example, to perform no validation of the remote host certificate
use OpenSearch::Client;
my $es = OpenSearch::Client->new(
nodes => [
"https://node1.mydomain.com:9200",
"https://node2.mydomain.com:9200",
],
ssl_options => {
SSL_verify_mode => 0x00,
}
);
To verify that the cerificate is signed by your own trusted CA Authority but not verify the hostname
use OpenSearch::Client;
my $es = OpenSearch::Client->new(
nodes => [
"https://node1.mydomain.com:9200",
"https://node2.mydomain.com:9200",
],
ssl_options => {
SSL_verify_mode => 0x01,
SSL_verifycn_scheme => 'none',
SSL_ca_file => '/path/to/ca_cert.pem',
}
);
If you want your client to present its own certificate to the remote server, then use:
use OpenSearch::Client;
my $es = OpenSearch::Client->new(
nodes => [
"https://node1.mydomain.com:9200",
"https://node2.mydomain.com:9200",
],
ssl_options => {
SSL_verify_mode => 0x01,
SSL_use_cert => 1,
SSL_ca_file => '/path/to/cacert.pem',
SSL_cert_file => '/path/to/client.pem',
SSL_key_file => '/path/to/client.pem',
}
);
METHODS
perform_request()
($status,$body) = $self->perform_request({
# required
method => 'GET|HEAD|POST|PUT|DELETE',
path => '/path/of/request',
qs => \%query_string_params,
# optional
data => $body_as_string,
mime_type => 'application/json',
timeout => $timeout
});
Sends the request to the associated OpenSearch node and returns a $status code and the decoded response $body, or throws an error if the request failed.
Inherited methods
From OpenSearch::Client::Role::Cxn
SEE ALSO
MANUAL
Documentation index OpenSearch::Client::Manual
HISTORY
This distribution is derived from Search::Elasticsearch version 7.714. All subsequent changes are unique to this distribution.
AUTHOR
Mark Dootson <mdootson@cpan.org> ( current maintainer )
CREDITS
OpenSearch::Client is based on Search::Elasticsearch version 7.714 by Enrico Zimuel <enrico.zimuel@elastic.co>.
COPYRIGHT AND LICENSE
Copyright (C) 2026 by Mark Dootson ( this distribution )
Copyright (C) 2021 by Elasticsearch BV ( original distribution )
This is free software, licensed under:
The Apache License, Version 2.0, January 2004