8000 [HttpClient] Adding default value for verify_peer by ThomasLandauer · Pull Request #15265 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[HttpClient] Adding default value for verify_peer #15265

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 26, 2021

Conversation

ThomasLandauer
Copy link
Contributor

It's also missing for verify_host - but I don't know the default value there ;-)

It's also missing for verify_host - but I don't know the default value there ;-)
@carsonbot carsonbot added this to the 4.4 milestone Apr 20, 2021
@javiereguiluz
Copy link
Member

Thanks Thomas! However, if I run this command in my app:

$ php bin/console config:dump framework http_client

I see this:

            # Indicates if the peer should be verified in an SSL/TLS context.
            verify_peer:          ~

            # Indicates if the host should exist as a certificate common name.
            verify_host:          ~

So, it looks like they are null by default 🤔 In the DI extension, the node is defiend as booleanNode() without a default value defined for it.

@ThomasLandauer
Copy link
Contributor Author

Hm. When I don't set a value, I'm getting this error on several URL's:

SSL peer certificate or SSH remote key was not OK for "https://www.example.com/".

Then, after setting 'verify_peer' => false, they're all gone. So I figured that the default must be true ;-) @nicolas-grekas What's the correct answer?

@carsonbot carsonbot changed the title Adding default value for verify_peer [HttpClient] Adding default value for verify_peer May 26, 2021
@javiereguiluz javiereguiluz merged commit 354d1a3 into symfony:4.4 May 26, 2021
@javiereguiluz
Copy link
Member

Thanks Thomas! I merged this because I found where the default value of these options is set and it's true for both of them (I changed verify_host while merging): https://github.com/symfony/http-client-contracts/blob/7e82f6084d7cae521a75ef2cb5c9457bbda785f4/HttpClientInterface.php#L61-L62

@ThomasLandauer ThomasLandauer deleted the patch-3 branch May 26, 2021 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0