Having a problem with the SSL connection, Elasticsearch is reporting an 'unknown CA' error and 411 has the error listed below.
If I create a simple ES PHP connector as follows, the connection works fine:
<?php
require 'vendor/autoload.php';
$hosts = ['https://localhost:9200'];
$myCert = '/home/mycert.pem';
use Elasticsearch\ClientBuilder;
$client = ClientBuilder::create()
->setHosts($hosts)
->setSSLVerification($myCert)
->build();
$params = [
'index' => 'logstash-2016.08.30',
'type' => 'logs',
'id' => 'AVbdvHEwAG-7iPeMOVRs'
];
$response = $client->get($params);
# Elasticsearch configuration
$config['elasticsearch'] = [
# Configuration for the 411 Alerts index.
'alerts' => [
'hosts' => ['https://localhost:9200'],
'index_hosts' => [],
'ssl_cert' => '/home/mycert.pem',
'index' => null,
'date_based' => false,
'date_field' => 'alert_date',
'src_url' => null,
],
# Configuration for the logstash index that 411 queries.
'logstash' => [
'hosts' => ['https://localhost:9200'],
'index_hosts' => [],
'ssl_cert' => '/home/mycert.pem',
'index' => 'logstash',
'date_based' => true,
'date_field' => '@timestamp',
'src_url' => null,
],
];
[Wed Aug 31 07:50:46.005023 2016] [:error] [pid 1598] [client 1.1.1.1:35031] except [NONE] Elasticsearch\\Common\\Exceptions\\NoNodesAvailableException: "No alive nodes found in your cluster" at [/var/www/411/vendor/elasticsearch/elasticsearch/src/Elasticsearch/ConnectionPool/StaticNoPingConnectionPool.php:51] 0:[Elasticsearch\\ConnectionPool\\StaticNoPingConnectionPool->nextConnection() called at [/var/www/411/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Transport.php:71]] 1:[Elasticsearch\\Transport->getConnection() called at [/var/www/411/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Transport.php:89]] 2:[Elasticsearch\\Transport->performRequest() called at [/var/www/411/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:228]] 3:[Elasticsearch\\Connections\\Connection->Elasticsearch\\Connections\\{closure}() called at [/var/www/411/vendor/react/promise/src/FulfilledPromise.php:25]] 4:[React\\Promise\\FulfilledPromise->then() called at [/var/www/411/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureValue.php:55]] 5:[GuzzleHttp\\Ring\\Future\\CompletedFutureValue->then() called at [/var/www/411/vendor/guzzlehttp/ringphp/src/Core.php:341]] 6:[GuzzleHttp\\Ring\\Core::proxy() called at [/var/www/411/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:283]] 7:[Elasticsearch\\Connections\\Connection->Elasticsearch\\Connections\\{closure}() called at [/var/www/411/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:159]] 8:[Elasticsearch\\Connections\\Connection->performRequest() called at [/var/www/411/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Transport.php:99]] 9:[Elasticsearch\\Transport->performRequest() called at [/var/www/411/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/AbstractEndpoint.php:79]] 10:[Elasticsearch\\Endpoints\\AbstractEndpoint->performRequest() called at [/var/www/411/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Namespaces/BooleanRequestWrapper.php:34]] 11:[Elasticsearch\\Namespaces\\BooleanRequestWrapper::performRequest() called at [/var/www/411/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Namespaces/IndicesNamespace.php:919]] 12:[Elasticsearch\\Namespaces\\IndicesNamespace->existsTemplate() called at [/var/www/411/phplib/ESClient.php:68]] 13:[FOO\\ESClient->initializeIndex() called at [/var/www/411/phplib/ESClient.php:31]] 14:[FOO\\ESClient->__construct() called at [/var/www/411/phplib/REST/Dashboard.php:16]] 15:[FOO\\Dashboard_REST->GET() called at [/var/www/411/phplib/REST.php:107]] 16:[FOO\\REST->route() called at [/var/www/411/htdocs/api/dashboard.php:6]], referer: http://myserver.com/