Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 234589a

Browse files
[HttpClient] fix capturing SSL certificates with NativeHttpClient
1 parent f3d8fd2 commit 234589a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Symfony/Component/HttpClient/Response/NativeResponse.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,13 @@ private function open(): void
158158
restore_error_handler();
159159
}
160160

161-
stream_set_blocking($h, false);
162-
$this->context = $this->resolveRedirect = null;
163-
164-
if (isset($context['ssl']['peer_certificate_chain'])) {
161+
if (isset($context['ssl']['capture_peer_cert_chain']) && isset(($context = stream_context_get_options($this->context))['ssl']['peer_certificate_chain'])) {
165162
$this->info['peer_certificate_chain'] = $context['ssl']['peer_certificate_chain'];
166163
}
167164

165+
stream_set_blocking($h, false);
166+
$this->context = $this->resolveRedirect = null;
167+
168168
// Create dechunk and inflate buffers
169169
if (isset($this->headers['content-length'])) {
170170
$this->remaining = (int) $this->headers['content-length'][0];

0 commit comments

Comments
 (0)