@@ -33,13 +33,13 @@ public function __construct(LoopInterface $loop, $server = true)
3333 $ this ->method = \STREAM_CRYPTO_METHOD_TLS_SERVER ;
3434
3535 if (\PHP_VERSION_ID < 70200 && \PHP_VERSION_ID >= 50600 ) {
36- $ this ->method |= \STREAM_CRYPTO_METHOD_TLSv1_0_SERVER | \STREAM_CRYPTO_METHOD_TLSv1_1_SERVER | \STREAM_CRYPTO_METHOD_TLSv1_2_SERVER;
36+ $ this ->method |= \STREAM_CRYPTO_METHOD_TLSv1_0_SERVER | \STREAM_CRYPTO_METHOD_TLSv1_1_SERVER | \STREAM_CRYPTO_METHOD_TLSv1_2_SERVER; // @codeCoverageIgnore
3737 }
3838 } else {
3939 $ this ->method = \STREAM_CRYPTO_METHOD_TLS_CLIENT ;
4040
4141 if (\PHP_VERSION_ID < 70200 && \PHP_VERSION_ID >= 50600 ) {
42- $ this ->method |= \STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | \STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | \STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
42+ $ this ->method |= \STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | \STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | \STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; // @codeCoverageIgnore
4343 }
4444 }
4545 }
@@ -49,22 +49,15 @@ public function enable(Connection $stream)
4949 return $ this ->toggle ($ stream , true );
5050 }
5151
52- public function disable (Connection $ stream )
53- {
54- return $ this ->toggle ($ stream , false );
55- }
56-
5752 public function toggle (Connection $ stream , $ toggle )
5853 {
5954 // pause actual stream instance to continue operation on raw stream socket
6055 $ stream ->pause ();
6156
6257 // TODO: add write() event to make sure we're not sending any excessive data
6358
64- $ deferred = new Deferred (function ($ _ , $ reject ) use ($ toggle ) {
65- // cancelling this leaves this stream in an inconsistent state…
66- $ reject (new \RuntimeException ('Cancelled toggling encryption ' . $ toggle ? 'on ' : 'off ' ));
67- });
59+ // cancelling this leaves this stream in an inconsistent state…
60+ $ deferred = new Deferred ();
6861
6962 // get actual stream socket from stream instance
7063 $ socket = $ stream ->stream ;
0 commit comments