From 25686f574e0bd9348cb2d488f243a4463ad9a963 Mon Sep 17 00:00:00 2001 From: Chris Boden Date: Fri, 20 Mar 2015 11:08:17 -0400 Subject: [PATCH 1/3] v0.4.3 changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d16d2a3..6775239 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 0.4.3 (2015-03-20) + +* Bugfix: Set peer name to hostname to correct security concern in PHP 5.6 (@WyyriHaximus) +* Bugfix: Always wrap secure to pull buffer due to regression in PHP +* Bugfix: SecureStream extends Stream to match documentation preventing BC (@clue) + ## 0.4.2 (2014-10-16) * Bugfix: Only toggle the stream crypto handshake once (@DaveRandom and @rdlowrey) From 0406b34fa3ec8f825c8e8722ebeda85f4b05f75f Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Sun, 21 Sep 2014 16:53:20 +0200 Subject: [PATCH 2/3] Integration test that performs a HTTP request against google.com --- tests/IntegrationTest.php | 72 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 tests/IntegrationTest.php diff --git a/tests/IntegrationTest.php b/tests/IntegrationTest.php new file mode 100644 index 0000000..511f377 --- /dev/null +++ b/tests/IntegrationTest.php @@ -0,0 +1,72 @@ +create('8.8.8.8', $loop); + + $connected = false; + $response = null; + + $connector = new Connector($loop, $dns); + $connector->create('google.com', 80) + ->then(function ($conn) use (&$connected) { + $connected = true; + $conn->write("GET / HTTP/1.0\r\n\r\n"); + return BufferedSink::createPromise($conn); + }) + ->then(function ($data) use (&$response) { + $response = $data; + }); + + $loop->run(); + + $this->assertTrue($connected); + $this->assertContains('HTTP/1.0 302 Found', $response); + } + + /** @test */ + public function gettingEncryptedStuffFromGoogleShouldWork() + { + $loop = new StreamSelectLoop(); + + $factory = new Factory(); + $dns = $factory->create('8.8.8.8', $loop); + + $connected = false; + $response = null; + + $secureConnector = new SecureConnector( + new Connector($loop, $dns), + $loop + ); + $secureConnector->create('google.com', 443) + ->then(function ($conn) use (&$connected) { + $connected = true; + $conn->write("GET / HTTP/1.0\r\n\r\n"); + return BufferedSink::createPromise($conn); + }) + ->then(function ($data) use (&$response) { + $response = $data; + }); + + $loop->run(); + + $this->assertTrue($connected); + $this->assertContains('HTTP/1.0 302 Found', $response); + } +} From 7cc7043f94cf5779d333e2bed5432af5c6c8cb96 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Sun, 21 Sep 2014 17:10:58 +0200 Subject: [PATCH 3/3] just check for beginning of HTTP line, since google is strange --- tests/IntegrationTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/IntegrationTest.php b/tests/IntegrationTest.php index 511f377..889a8cb 100644 --- a/tests/IntegrationTest.php +++ b/tests/IntegrationTest.php @@ -36,7 +36,7 @@ public function gettingStuffFromGoogleShouldWork() $loop->run(); $this->assertTrue($connected); - $this->assertContains('HTTP/1.0 302 Found', $response); + $this->assertRegExp('#^HTTP/1\.0#', $response); } /** @test */ @@ -67,6 +67,6 @@ public function gettingEncryptedStuffFromGoogleShouldWork() $loop->run(); $this->assertTrue($connected); - $this->assertContains('HTTP/1.0 302 Found', $response); + $this->assertRegExp('#^HTTP/1\.0#', $response); } }