Skip to content

Commit

Permalink
Fix elastic client builder for connecting to elastic vm
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Richter committed Nov 8, 2024
1 parent 7f76e86 commit 32dcb00
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Classes/Common/ElasticClientBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ protected function autoconfig (): ElasticClientBuilder {
$this->setBasicAuthentication('elastic', $this->password);
}
if ($this->caFilePath) {
$this->setSSLVerification($this->caFilePath);
$this->setCABundle($this->caFilePath);
}

return $this;
Expand All @@ -65,7 +65,8 @@ private function setCaFilePath(): void
}

$this->caFilePath = $this->extConf->
only('elastcCredentialsFilePath', 'elasticCaFileName')->
sortKeysDesc()->
only('elasticCredentialsFilePath', 'elasticCaFileName')->
implode('/');
}

Expand All @@ -77,11 +78,13 @@ private function setPassword(): void
}

$passwordFilePath = $this->extConf->
sortKeys()->
only('elasticCredentialsFilePath', 'elasticPwdFileName')->
implode('/');
$passwordFile = fopen($passwordFilePath, 'r') or
die($passwordFilePath . ' not found. Check your extension\'s configuration');
$size = filesize($passwordFilePath);

$this->password = $passwordFile->getContents();
$this->password = trim(fread($passwordFile, $size));
}
}

0 comments on commit 32dcb00

Please sign in to comment.