diff --git a/includes/class-pantheoncurl.php b/includes/class-pantheoncurl.php index 248dd476..332a6bd6 100644 --- a/includes/class-pantheoncurl.php +++ b/includes/class-pantheoncurl.php @@ -5,7 +5,7 @@ * @package Solr_Power */ -use Solarium\Core\Client\Adapter\Curl as Curl; +use Solarium\Core\Client\Adapter\Curl; /** * Override Solarium so that more options can be set before executing curl. @@ -23,8 +23,12 @@ public function createHandle( $request, $endpoint ) { $handler = parent::createHandle( $request, $endpoint ); if ( defined( 'PANTHEON_ENVIRONMENT' ) ) { curl_setopt( $handler, CURLOPT_SSL_VERIFYPEER, false ); - $client_cert = $_SERVER['HOME'] . '/certs/binding.pem'; - curl_setopt( $handler, CURLOPT_SSLCERT, $client_cert ); + if ( getenv( 'JOB_RUNTIME' ) !== 'UJR' && getenv( 'MTLSPROXY_ENABLED' ) === 'true' ) { + curl_setopt( $handler, CURLOPT_SSL_VERIFYHOST, 0 ); + } else { + $client_cert = $_SERVER['HOME'] . '/certs/binding.pem'; + curl_setopt( $handler, CURLOPT_SSLCERT, $client_cert ); + } } return $handler; diff --git a/includes/class-solrpower-api.php b/includes/class-solrpower-api.php index 75edcc5e..9e22a36d 100644 --- a/includes/class-solrpower-api.php +++ b/includes/class-solrpower-api.php @@ -116,7 +116,7 @@ function submit_schema() { } $path = $this->compute_path(); - $url = $this->get_default_scheme() . '://' . getenv( 'PANTHEON_INDEX_HOST' ) . ':' . getenv( 'PANTHEON_INDEX_PORT' ) . $path; + $url = $this->get_default_scheme() . '://' . getenv( 'INDEX_PROXY_HOST' ) . ':' . getenv( 'INDEX_PROXY_PORT' ) . $path; $client_cert = self::get_cert_path(); /* @@ -139,7 +139,7 @@ function submit_schema() { // set URL and other appropriate options. $opts = array( CURLOPT_URL => $url, - CURLOPT_PORT => getenv( 'PANTHEON_INDEX_PORT' ), + CURLOPT_PORT => getenv( 'INDEX_PROXY_PORT' ), CURLOPT_RETURNTRANSFER => 1, CURLOPT_SSLCERT => $client_cert, CURLOPT_SSL_VERIFYPEER => false, @@ -220,8 +220,8 @@ function get_solr() { $solarium_config = array( 'endpoint' => array( 'localhost' => array( - 'host' => getenv( 'PANTHEON_INDEX_HOST' ), - 'port' => getenv( 'PANTHEON_INDEX_PORT' ), + 'host' => getenv( 'INDEX_PROXY_HOST' ), + 'port' => getenv( 'INDEX_PROXY_PORT' ), 'scheme' => $this->get_default_scheme(), 'path' => $this->compute_path(), 'ssl' => array( @@ -605,8 +605,8 @@ public function get_server_info() { return array( 'ping_status' => $ping, - 'ip_address' => getenv( 'PANTHEON_INDEX_HOST' ), - 'port' => getenv( 'PANTHEON_INDEX_PORT' ), + 'ip_address' => getenv( 'INDEX_PROXY_HOST' ), + 'port' => getenv( 'INDEX_PROXY_PORT' ), 'path' => $this->compute_path(), );