ruflin / Elastica

Elastica is a PHP client for elasticsearch
http://elastica.io/
MIT License
2.26k stars 734 forks source link

Elastica with OpenDistro - Auth #1731

Open EliuFlorez opened 4 years ago

EliuFlorez commented 4 years ago

Hi Elasctica Team, You know I would like to use Elastica with OpenDistro in which I require authentication with the user and the ssl layer in --insecure example: curl -XGET --insecure https: // localhost: 9200 -u admin: admin Is there any way to perform that authentication like this. Since for endpoint consumption the same authentication must be identified.

philkra commented 4 years ago

Hi @EliuFlorez , basic authentication is available in Elastica. You need to add the username and password in your configuration (ref: ClientConfiguration.php#L35).

Can you please verify if this resolves your issue?

EliuFlorez commented 4 years ago

@philkra If I already had the username and password settings but I had to make some changes in Transport / HTTP.php since the scheme has to be HTTPS and cRUL \ curl_setopt ($ conn, CURLOPT_SSL_VERIFYPEER, false); So I achieve connection with OpenDistro

philkra commented 4 years ago

Alright, now I fully grasp the questions, sorry for the half baked answer. Can you, please post the snippet how you currently instantiate the client?

DavidFeller commented 2 years ago

@EliuFlorez I just stumbled across the same thing. Would you share your modifications to Http.php etc.?