@@ -74,10 +74,6 @@ public function getConfig(): ConnectionConfig
7474
7575 private function establishConnection (): BunnyClient
7676 {
77- if ($ this ->config ->isSslOn ()) {
78- throw new \LogicException ('The bunny library does not support SSL connections ' );
79- }
80-
8177 if (false == $ this ->client ) {
8278 $ bunnyConfig = [];
8379 $ bunnyConfig ['host ' ] = $ this ->config ->getHost ();
@@ -102,6 +98,20 @@ private function establishConnection(): BunnyClient
10298 $ bunnyConfig ['tcp_nodelay ' ] = $ this ->config ->getOption ('tcp_nodelay ' );
10399 }
104100
101+ if ($ this ->config ->isSslOn ()) {
102+ $ sslOptions = array_filter ([
103+ 'cafile ' => $ this ->config ->getSslCaCert (),
104+ 'local_cert ' => $ this ->config ->getSslCert (),
105+ 'local_pk ' => $ this ->config ->getSslKey (),
106+ 'verify_peer ' => $ this ->config ->isSslVerify (),
107+ 'verify_peer_name ' => $ this ->config ->isSslVerify (),
108+ 'passphrase ' => $ this ->getConfig ()->getSslPassPhrase (),
109+ 'ciphers ' => $ this ->config ->getOption ('ciphers ' , '' ),
110+ ], function ($ value ) { return '' !== $ value ; });
111+
112+ $ bunnyConfig ['ssl ' ] = $ sslOptions ;
113+ }
114+
105115 $ this ->client = new BunnyClient ($ bunnyConfig );
106116 $ this ->client ->connect ();
107117 }
0 commit comments