Perl Search::Elasticsearch doesn't work with SSL enabled node with Self-signed certificate Perl Search::Elasticsearch doesn't work with SSL enabled node with Self-signed certificate elasticsearch elasticsearch

Perl Search::Elasticsearch doesn't work with SSL enabled node with Self-signed certificate


Using -k is synonym to --insecure so curl doesn't verify the certificate. The question is then, how useful is it to query over an encrypted SSL channel while allowing insecure connections?

That kind of defeats the purpose of using SSL in the first place, right?

If you have the CA that signed the certificate (which you should), then you should use it with the --cacert curl switch

curl --cacert /path/to/cacert.pem https://testuser:testpwd@192.168.0.67:9200

or with Perl you can also specify the CA cert in the ssl_options

use Search::Elasticsearch;use IO::Socket::SSL; my $es = Search::Elasticsearch->new(    nodes => [        "192.168.0.66:9200"    ],    userinfo => "testuser:testpwd",    debug => 1,    ssl_options => {        SSL_verify_mode     => SSL_VERIFY_PEER,        SSL_ca_file         => '/path/to/cacert.pem',        SSL_verifycn_scheme => 'http',    });