@@ -420,8 +420,10 @@ public function testEmitsErrorIfConnectionIsClosedBeforeHandshake()
420420
421421 $ error = Block \await ($ errorEvent , $ loop , self ::TIMEOUT );
422422
423+ // Connection from tcp://127.0.0.1:39528 failed during TLS handshake: Connection lost during TLS handshak
423424 $ this ->assertTrue ($ error instanceof \RuntimeException);
424- $ this ->assertEquals ('Connection lost during TLS handshake ' , $ error ->getMessage ());
425+ $ this ->assertStringStartsWith ('Connection from tcp:// ' , $ error ->getMessage ());
426+ $ this ->assertStringEndsWith ('failed during TLS handshake: Connection lost during TLS handshake ' , $ error ->getMessage ());
425427 $ this ->assertEquals (defined ('SOCKET_ECONNRESET ' ) ? SOCKET_ECONNRESET : 0 , $ error ->getCode ());
426428 }
427429
@@ -445,8 +447,10 @@ public function testEmitsErrorIfConnectionIsClosedWithIncompleteHandshake()
445447
446448 $ error = Block \await ($ errorEvent , $ loop , self ::TIMEOUT );
447449
450+ // Connection from tcp://127.0.0.1:39528 failed during TLS handshake: Connection lost during TLS handshak
448451 $ this ->assertTrue ($ error instanceof \RuntimeException);
449- $ this ->assertEquals ('Connection lost during TLS handshake ' , $ error ->getMessage ());
452+ $ this ->assertStringStartsWith ('Connection from tcp:// ' , $ error ->getMessage ());
453+ $ this ->assertStringEndsWith ('failed during TLS handshake: Connection lost during TLS handshake ' , $ error ->getMessage ());
450454 $ this ->assertEquals (defined ('SOCKET_ECONNRESET ' ) ? SOCKET_ECONNRESET : 0 , $ error ->getCode ());
451455 }
452456
0 commit comments