Skip to content

Instantly share code, notes, and snippets.

@ahebrank
Last active October 17, 2017 13:44
Show Gist options
  • Select an option

  • Save ahebrank/1d990fc677e940d97aec1460f31b8edf to your computer and use it in GitHub Desktop.

Select an option

Save ahebrank/1d990fc677e940d97aec1460f31b8edf to your computer and use it in GitHub Desktop.
Pantheon solr patch
diff --git a/src/Plugin/SolrConnector/PantheonSolrConnector.php b/src/Plugin/SolrConnector/PantheonSolrConnector.php
index e4702b8..fd45a30 100644
--- a/src/Plugin/SolrConnector/PantheonSolrConnector.php
+++ b/src/Plugin/SolrConnector/PantheonSolrConnector.php
@@ -71,6 +71,14 @@ class PantheonSolrConnector extends StandardSolrConnector {
'path' => '/sites/self/environments/' . $_ENV['PANTHEON_ENVIRONMENT'] . '/index',
];
}
+ else {
+ $pantheon_specific_configuration = [
+ 'scheme' => 'https',
+ 'host' => 'solr', # docker network hostname
+ 'port' => 449,
+ 'path' => '/sites/self/environments/kalabox/index',
+ ];
+ }
return $pantheon_specific_configuration + parent::defaultConfiguration();
}
diff --git a/src/Solarium/PantheonCurl.php b/src/Solarium/PantheonCurl.php
index 3837447..d1e5d90 100644
--- a/src/Solarium/PantheonCurl.php
+++ b/src/Solarium/PantheonCurl.php
@@ -20,6 +20,11 @@ class PantheonCurl extends Curl {
$client_cert = $_SERVER['HOME'] . '/certs/binding.pem';
curl_setopt($handler, CURLOPT_SSLCERT, $client_cert);
}
+ else {
+ curl_setopt($handler, CURLOPT_SSL_VERIFYPEER, FALSE);
+ $client_cert = '/certs/solr.pem';
+ curl_setopt($handler, CURLOPT_SSLCERT, $client_cert);
+ }
return $handler;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment