Skip to content

Commit

Permalink
Not connect to Cloud Working on localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
Smokietr committed Jan 28, 2021
1 parent 0d80e53 commit 36a07db
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Elasticsearch/Connections/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ public function __construct(
}

$connectionParams['client']['curl'][CURLOPT_PORT] = $hostDetails['port'];

if(!in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'])){
$connectionParams['client']['curl'][CURLOPT_SSL_VERIFYHOST] = 0;
$connectionParams['client']['curl'][CURLOPT_SSL_VERIFYPEER] = 0;
}

if (isset($connectionParams['client']['headers'])) {
$this->headers = $connectionParams['client']['headers'];
Expand Down

0 comments on commit 36a07db

Please sign in to comment.