IMPORTANT: No additional bug fixes or documentation updates
will be released for this version. For the latest information, see the
current release documentation.
Using Authentication with SSL
edit
IMPORTANT: This documentation is no longer updated. Refer to Elastic's version policy and the latest documentation.
Using Authentication with SSL
editIt is possible to use HTTP authentication with SSL. Simply specify https
in the URI, configure SSL settings as required and provide authentication credentials. For example, this snippet will authenticate using Basic HTTP auth and a self-signed certificate:
$params = array(); $params['hosts'] = array ( 'https://localhost:9200' ); $params['connectionParams']['auth'] = array('user', 'pass', 'Basic'); $params['guzzleOptions'] = array( \Guzzle\Http\Client::SSL_CERT_AUTHORITY => 'system', \Guzzle\Http\Client::CURL_OPTIONS => [ CURLOPT_SSL_VERIFYPEER => true, CURLOPT_SSL_VERIFYHOST => 2, CURLOPT_CAINFO => 'cacert.pem', CURLOPT_SSLCERTTYPE => 'PEM', ] ); $client = new Elasticsearch\Client($params);
Was this helpful?
Thank you for your feedback.