File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
selenium/test/authnz-msg-protocols Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 1+ export MQTT_USE_MTLS=true
Original file line number Diff line number Diff line change @@ -16,14 +16,13 @@ describe('Having MQTT protocol enbled and the following auth_backends: ' + backe
1616 let mqttOptions
1717 let expectations = [ ]
1818 let mqttProtocol = process . env . MQTT_PROTOCOL || 'mqtt'
19+ let usemtls = process . env . MQTT_USE_MTLS || false
1920 let rabbit = process . env . RABBITMQ_HOSTNAME || 'localhost'
2021 let mqttUrl = process . env . RABBITMQ_MQTT_URL || "mqtt://" + rabbit + ":1883"
2122 let username = process . env . RABBITMQ_AMQP_USERNAME
2223 let password = process . env . RABBITMQ_AMQP_PASSWORD
2324 let client_id = process . env . RABBITMQ_AMQP_USERNAME || 'selenium-client'
2425
25- console . log ( "RABBITMQ_CERTS : " + process . env . RABBITMQ_CERTS )
26-
2726 before ( function ( ) {
2827 if ( backends . includes ( "http" ) && username . includes ( "http" ) ) {
2928 reset ( )
@@ -45,14 +44,17 @@ describe('Having MQTT protocol enbled and the following auth_backends: ' + backe
4544 protocolVersion : 4 ,
4645 keepalive : 10000 ,
4746 clean : false ,
48- reconnectPeriod : '1000' ,
49- username : username ,
50- password : password
47+ reconnectPeriod : '1000'
5148 }
5249 if ( mqttProtocol == 'mqtts' ) {
53- mqttOptions [ "ca" ] = [ fs . readFileSync ( process . env . RABBITMQ_CERTS + "/ca_rabbitmq_certificate.pem" ) ]
50+ mqttOptions [ "ca" ] = [ fs . readFileSync ( process . env . RABBITMQ_CERTS + "/ca_rabbitmq_certificate.pem" ) ]
51+ }
52+ if ( usemtls ) {
5453 mqttOptions [ "cert" ] = fs . readFileSync ( process . env . RABBITMQ_CERTS + "/client_rabbitmq_certificate.pem" )
5554 mqttOptions [ "key" ] = fs . readFileSync ( process . env . RABBITMQ_CERTS + "/client_rabbitmq_key.pem" )
55+ } else {
56+ mqttOptions [ "username" ] = username
57+ mqttOptions [ "password" ] = password
5658 }
5759 } )
5860
You can’t perform that action at this time.
0 commit comments