Skip to content

Commit

Permalink
bug #35168 [HttpClient] fix capturing SSL certificates with NativeHtt…
Browse files Browse the repository at this point in the history
…pClient (nicolas-grekas)

This PR was merged into the 4.3 branch.

Discussion
----------

[HttpClient] fix capturing SSL certificates with NativeHttpClient

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Commits
-------

234589a [HttpClient] fix capturing SSL certificates with NativeHttpClient
  • Loading branch information
nicolas-grekas committed Jan 4, 2020
2 parents d394214 + 234589a commit cf83c60
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Symfony/Component/HttpClient/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 cf83c60

Please sign in to comment.