Our Solr instance is on a remote server and uses https so we need to be able to set the context resource otherwise drupal_http_request() borks. e.g.
$context = array(
'ssl' => array(
'verify_peer' => true,
'cafile' => '/path/to/RapidSSL_CA_bundle.pem',
)
);I see there is a setStreamContext method in SearchApiSolrConnection, but how/where should that be called from?
Comments
Comment #2
kmcculloch commented@hitfactory I just came across the need for this myself as part of a D7 project migration to PHP 7. In order to bake this configuration into search_api_solr you'd need to either patch it or override the server connection class. Rather than do that for every contrib module that might need it, I submitted a patch to this thread in D7 core:
https://www.drupal.org/node/1081192#comment-12039235
Would be interested to hear if it meets your needs.
Comment #3
drunken monkey#2 does look like it might solve this, yes, thanks!
Otherwise, either override the backend class to incldude the necessary code, or maybe use a hook to call
$server->getSolrConnection()->setStreamContext()early enough during search/indexing.Comment #4
aklump commentedRegister the service class like so:
Create a service class override that sets the context :
Testing using Drupal 7.67 and search_api_solr 7.x-1.14
Comment #5
mkalkbrennerThis issue was closed due to lack of activity over a long period of time. If the issue is still acute for you, feel free to reopen it and describe the current state.