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

3.x - stream_context_create on php 5.6.8 expect peer_name without transport #7579

Closed
Graziel opened this issue Oct 19, 2015 · 2 comments
Closed
Assignees
Labels
Milestone

Comments

@Graziel
Copy link
Contributor

Graziel commented Oct 19, 2015

when using ssl:// in host Network\Socket throws error

stream_socket_client(): Peer certificate CN=smtp.gmail.com' did not match expected CN=ssl://smtp.gmail.com' stream_socket_client(): Failed to enable crypto stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Unknown error)

the peer_name is set as host:
https://github.com/cakephp/cakephp/blob/master/src/Network/Socket.php#L199

in http://book.cakephp.org/3.0/en/core-libraries/email.html#configuring-transports there is note about just adding 'ssl://' to host but on code it expects it on 'protocol' option
https://github.com/cakephp/cakephp/blob/master/src/Network/Socket.php#L133

also on side note

https://github.com/cakephp/cakephp/blob/master/src/Network/Socket.php#L131
and can be still null on
https://github.com/cakephp/cakephp/blob/master/src/Network/Socket.php#L150

@markstory markstory added this to the 3.1.3 milestone Oct 20, 2015
@markstory markstory self-assigned this Oct 20, 2015
@markstory
Copy link
Member

We should be able to split out the protocol from the host in connect().

markstory added a commit that referenced this issue Oct 20, 2015
This avoids issues in PHP 5.6 where certificate validation fails when
`ssl://smtp.gmail.com` is used as a host name.

Refs #7579
@markstory
Copy link
Member

Pull request is up now.

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

No branches or pull requests

2 participants