Skip to content

Commit 6dc2d25

Browse files
committed
fix ssl test. add passphrase and local key ssl options.
1 parent 1408b3c commit 6dc2d25

File tree

9 files changed

+16
-13
lines changed

9 files changed

+16
-13
lines changed

composer.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"illuminate/database": "5.5.*",
1414
"illuminate/support": "5.5.*",
1515
"illuminate/queue": "5.5.*",
16-
"enqueue/amqp-lib": "dev-ssl-filter-out-null-options as 0.8.4"
16+
"enqueue/amqp-lib": "0.8.5"
1717
},
1818
"require-dev": {
1919
"phpunit/phpunit": "~6.0",
@@ -41,11 +41,5 @@
4141
"test": "vendor/bin/phpunit"
4242
},
4343
"minimum-stability": "dev",
44-
"prefer-stable": true,
45-
"repositories": [
46-
{
47-
"type": "vcs",
48-
"url": "git@github.com:formapro-forks/amqp-lib.git"
49-
}
50-
]
44+
"prefer-stable": true
5145
}

config/rabbitmq.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
'ssl_on' => env('RABBITMQ_SSL', false),
7878
'cafile' => env('RABBITMQ_SSL_CAFILE', null),
7979
'local_cert' => env('RABBITMQ_SSL_LOCALCERT', null),
80+
'local_key' => env('RABBITMQ_SSL_LOCALKEY', null),
8081
'verify_peer' => env('RABBITMQ_SSL_VERIFY_PEER', true),
8182
'passphrase' => env('RABBITMQ_SSL_PASSPHRASE', null),
8283
]

src/Queue/Connectors/RabbitMQConnector.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,8 @@ public function connect(array $config): Queue
5454
'ssl_verify' => $config['ssl_params']['verify_peer'],
5555
'ssl_cacert' => $config['ssl_params']['cafile'],
5656
'ssl_cert' => $config['ssl_params']['local_cert'],
57-
58-
// TODO 'ssl_key' not supported
59-
// TODO: add passphrase
57+
'ssl_key' => $config['ssl_params']['local_key'],
58+
'ssl_passphrase' => $config['ssl_params']['passphrase'],
6059
]);
6160

6261
if ($factory instanceof DelayStrategyAware) {

tests/Functional/SendAndReceiveDelayedMessageTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public function test()
4646
'ssl_on' => false,
4747
'cafile' => null,
4848
'local_cert' => null,
49+
'local_key' => null,
4950
'verify_peer' => true,
5051
'passphrase' => null,
5152
]

tests/Functional/SendAndReceiveMessageTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public function test()
4646
'ssl_on' => false,
4747
'cafile' => null,
4848
'local_cert' => null,
49+
'local_key' => null,
4950
'verify_peer' => true,
5051
'passphrase' => null,
5152
]

tests/Functional/SslConnectionTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public function testConnectorEstablishSecureConnectionWithRabbitMQBroker()
4747
'ssl_on' => true,
4848
'cafile' => getenv('RABBITMQ_SSL_CAFILE'),
4949
'local_cert' => null,
50+
'local_key' => null,
5051
'verify_peer' => false,
5152
'passphrase' => null,
5253
]

tests/Functional/StreamConnectionTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public function testConnectorEstablishSecureConnectionWithRabbitMQBroker()
4545
'ssl_on' => false,
4646
'cafile' => null,
4747
'local_cert' => null,
48+
'local_key' => null,
4849
'verify_peer' => true,
4950
'passphrase' => null,
5051
]

tests/Queue/Connectors/RabbitMQConnectorTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ public function testShouldPassExpectedConfigToConnectionFactory()
7272
'ssl_verify' => 'theVerifyPeer',
7373
'ssl_cacert' => 'theCafile',
7474
'ssl_cert' => 'theLocalCert',
75+
'ssl_key' => 'theLocalKey',
76+
'ssl_passphrase' => 'thePassPhrase',
7577
], $config);
7678
};
7779

@@ -160,7 +162,9 @@ private function createDummyConfig()
160162
'ssl_on' => 'theSslOn',
161163
'verify_peer' => 'theVerifyPeer',
162164
'cafile' => 'theCafile',
163-
'local_cert' => 'theLocalCert'
165+
'local_cert' => 'theLocalCert',
166+
'local_key' => 'theLocalKey',
167+
'passphrase' => 'thePassPhrase',
164168
],
165169
'queue' => 'aQueueName',
166170
'exchange_declare' => false,

tests/Queue/RabbitMQQueueTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,8 @@ private function createDummyConfig()
473473
'ssl_on' => 'aSslOn',
474474
'verify_peer' => 'aVerifyPeer',
475475
'cafile' => 'aCafile',
476-
'local_cert' => 'aLocalCert'
476+
'local_cert' => 'aLocalCert',
477+
'local_key' => 'aLocalKey',
477478
],
478479
'queue' => 'aQueueName',
479480
'exchange_declare' => false,

0 commit comments

Comments
 (0)