Skip to content
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

HttpSocket when 'ssl_verify_host' is false, set the 'verify_peer_name' context option to false. #7078

Closed
nojimage opened this issue Jul 21, 2015 · 5 comments

Comments

@nojimage
Copy link
Contributor

In CakePHP 2.x.

PHP >= 5.6.0, SSL context options add the verify_peer_name and this default value is TRUE.

http://php.net/manual/en/context.ssl.php

When the actual hostname and the common name of the certificate is different (like during development), if I want to disable the check of the hostname of the certificate, it must be written as below:

$http = new HttpSocket([
   'ssl_verify_host' => false,
   'ssl_verify_peer_name' => false,
]);

This is redundant.
I without having to worry about the version of PHP, I want to finish by writing the only 'ssl_verify_host' = false.

@markstory
Copy link
Member

Seems pretty reasonable to me.

@markstory markstory modified the milestones: 2.7.1, 2.7.2, 2.8.0 Jul 24, 2015
@DavidOliver
Copy link

Am I right in thinking this is a proposal to set ssl_verify_peer_name to false whenever ssl_verify_host is set to false? If so, I'm no expert but wouldn't that be creating a gotcha?

For example, because I'm currently running < PHP 5.6 I've had to set ssl_verify_host (“set to false if you wish to ignore hostname match errors when validating certificates”) to false because PHP's wildcard matching for CN wasn't working/in place. However, I didn't need to set ssl_verify_peer to false (“Set to false to disable SSL verification. This is not recommended.”). Quotes in brackets are from Cake 2's documentation.

The actual issue here seems to be the lack of an SSL certificate for a development server, or using TLS when it's not required in development.

@josegonzalez
Copy link
Member

You should use an ssl certificate in development if you use one in production, so I'm 👎 on changing this.

If a developer needs the option, they can set it manually in their own code.

We should default to secure and let people work to make things insecure :)

@markstory
Copy link
Member

Good point @josegonzalez. Closing as forcing people to think about their security tradeoffs is important.

@nojimage
Copy link
Contributor Author

nojimage commented Sep 2, 2015

I see. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants