diff --git a/tests/IntegrationTest.php b/tests/IntegrationTest.php
index 9e16281..a22caf9 100644
--- a/tests/IntegrationTest.php
+++ b/tests/IntegrationTest.php
@@ -56,6 +56,37 @@ public function gettingEncryptedStuffFromGoogleShouldWork()
$this->assertRegExp('#^HTTP/1\.0#', $response);
}
+ /** @test */
+ public function gettingEncryptedStuffFromHostWithSniShouldWork()
+ {
+ if (defined('HHVM_VERSION')) {
+ $this->markTestSkipped('Not supported on HHVM');
+ }
+
+ $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
+ );
+
+ $conn = Block\await($secureConnector->create('reactphp.sni.velox.ch', 443), $loop);
+
+ $conn->write("GET / HTTP/1.0\r\nHost: reactphp.sni.velox.ch\r\n\r\n");
+
+ $response = Block\await(BufferedSink::createPromise($conn), $loop);
+
+ $this->assertRegExp('#^HTTP/1\.[01] 2\d\d#', $response);
+ $this->assertRegExp('#reactphp\.sni\.velox\.ch#', $response);
+ $this->assertRegExp('#CN=\*\.sni\.velox\.ch#', $response);
+ }
+
/** @test */
public function testSelfSignedRejectsIfVerificationIsEnabled()
{