Skip to content

Conversation

@DaveRandom
Copy link
Contributor

As of PHP 5.6, peer verification on SSL/TLS streams is enabled by default. Since DNS names are resolved before attempting to create the stream and PHP is passed the IP address, it expects the certificate name to match the IP address and not the supplied DNS name.

This patch fixes the problem by setting the ssl/peer_name context option on the stream after it is created and before attempting to enable crypto.

@clue
Copy link
Contributor

clue commented Jun 11, 2014

Thanks, the change looks good to me 👍

Just for the reference, the peer_name context option is currently not documented (as PHP 5.6 is still beta) ¹ ². Setting this option for any other version has no effect.

Just for the reference, relevant changes and related discussion from other projects:
composer/getcomposer.org@5f82887#commitcomment-5956599
sebastianbergmann/phpunit@e16678d

@DaveRandom
Copy link
Contributor Author

@clue FYI I have a WIP patch for documenting the SSL changes in 5.6 that will be pushed before 5.6.0 is tagged, I'm working with @rdlowrey to make sure all changes are documented correctly before pushing it (read: I need to talk to him about it but keep getting distracted by other lines of conversation :-P)

@clue
Copy link
Contributor

clue commented Jun 14, 2014

@DaveRandom awesome and thanks for the update. Perhaps I should just keep bugging you to talk to @rdlowrey :P

Either way, the changes look good to me and I'd like to merge this PR after giving anybody some time to review. Thanks!

@DaveRandom
Copy link
Contributor Author

Closing in favour of #17

@DaveRandom DaveRandom closed this Sep 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants