Skip to content

Commit

Permalink
[HttpClient] fix capturing SSL certificates with NativeHttpClient
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Jan 2, 2020
1 parent c523746 commit ff9ff53
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Response/NativeResponse.php
Expand Up @@ -158,13 +158,13 @@ private function open(): void
restore_error_handler();
}

stream_set_blocking($h, false);
$this->context = $this->resolveRedirect = null;

if (isset($context['ssl']['peer_certificate_chain'])) {
if (isset($context['ssl']['capture_peer_cert_chain']) && isset(($context = stream_context_get_options($this->context))['ssl']['peer_certificate_chain'])) {
$this->info['peer_certificate_chain'] = $context['ssl']['peer_certificate_chain'];
}

stream_set_blocking($h, false);
$this->context = $this->resolveRedirect = null;

// Create dechunk and inflate buffers
if (isset($this->headers['content-length'])) {
$this->remaining = (int) $this->headers['content-length'][0];
Expand Down

0 comments on commit ff9ff53

Please sign in to comment.