File tree Expand file tree Collapse file tree 9 files changed +38
-13
lines changed
amqp10-roundtriptest/src/main/java/com/rabbitmq/amqp1_0 Expand file tree Collapse file tree 9 files changed +38
-13
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ public static void main(String args[]) throws Exception {
3131 String uri = scheme + "://" + hostname + ":" + port ;
3232 boolean usemtls = Boolean .parseBoolean (getEnv ("AMQP_USE_MTLS" , "false" ));
3333 String certsLocation = getEnv ("RABBITMQ_CERTS" );
34-
34+
3535 if ("amqps" .equals (scheme )) {
3636 List <String > connectionParams = new ArrayList <String >();
3737
@@ -40,12 +40,13 @@ public static void main(String args[]) throws Exception {
4040 connectionParams .add ("transport.verifyHost=true" );
4141
4242 if (usemtls ) {
43- connectionParams .add ("transport.keyStoreLocation=" + certsLocation + "/rabbitmq .jks" );
43+ connectionParams .add ("transport.keyStoreLocation=" + certsLocation + "/client_rabbitmq .jks" );
4444 connectionParams .add ("transport.keyStorePassword=foobar" );
45- connectionParams .add ("transport.keyAlias=rabbitmq-tls" );
45+ connectionParams .add ("transport.keyAlias=client- rabbitmq-tls" );
4646 }
4747 if (!connectionParams .isEmpty ()) {
48- uri += "?" + java .net .URLEncoder .encode (String .join ("&" , connectionParams ));
48+ String uri2 = uri + "?" + java .net .URLEncoder .encode (String .join ("&" , connectionParams ));
49+ System .out .println ("Using AMQP URI " + uri2 );
4950 }
5051 }
5152
Original file line number Diff line number Diff line change @@ -16,7 +16,8 @@ init_rabbitmq() {
1616 mkdir ${RABBITMQ_CONFIG_DIR} /certs
1717 fi
1818 generate-ca-server-client-kpi rabbitmq $RABBITMQ_CONFIG_DIR /certs
19- generate-keystore-if-required rabbitmq $RABBITMQ_CONFIG_DIR /certs
19+ generate-server-keystore-if-required rabbitmq $RABBITMQ_CONFIG_DIR /certs
20+ generate-client-keystore-if-required rabbitmq $RABBITMQ_CONFIG_DIR /certs
2021 generate-truststore-if-required rabbitmq $RABBITMQ_CONFIG_DIR /certs
2122}
2223
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ init_uaa() {
1818 print " > UAA_DOCKER_IMAGE: ${UAA_DOCKER_IMAGE} "
1919
2020 generate-ca-server-client-kpi uaa $UAA_CONFIG_DIR
21- generate-keystore-if-required uaa $UAA_CONFIG_DIR
21+ generate-server- keystore-if-required uaa $UAA_CONFIG_DIR
2222}
2323start_uaa () {
2424 begin " Starting UAA ..."
Original file line number Diff line number Diff line change @@ -434,17 +434,35 @@ generate-truststore-if-required() {
434434 -noprompt
435435 fi
436436}
437- generate-keystore-if-required () {
437+ generate-server- keystore-if-required () {
438438 NAME=$1
439439 FOLDER=$2
440440 if [[ ! -f " ${FOLDER} /${NAME} .jks " ]]; then
441441 keytool -importkeystore \
442- -destkeystore ${FOLDER} /${NAME} .jks \
442+ -destkeystore ${FOLDER} /server_ ${NAME} .jks \
443443 -srckeystore ${FOLDER} /server_${NAME} .p12 \
444444 -deststoretype pkcs12 \
445445 -srcstoretype pkcs12 \
446446 -alias 1 \
447- -destalias ${NAME} -tls \
447+ -destalias server-${NAME} -tls \
448+ -deststorepass foobar \
449+ -destkeypass foobar \
450+ -srcstorepass " " \
451+ -srckeypass " " \
452+ -noprompt
453+ fi
454+ }
455+ generate-client-keystore-if-required () {
456+ NAME=$1
457+ FOLDER=$2
458+ if [[ ! -f " ${FOLDER} /${NAME} .jks " ]]; then
459+ keytool -importkeystore \
460+ -destkeystore ${FOLDER} /client_${NAME} .jks \
461+ -srckeystore ${FOLDER} /client_${NAME} .p12 \
462+ -deststoretype pkcs12 \
463+ -srcstoretype pkcs12 \
464+ -alias 1 \
465+ -destalias client-${NAME} -tls \
448466 -deststorepass foobar \
449467 -destkeypass foobar \
450468 -srcstorepass " " \
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ describe('Having AMQP 1.0 protocol enabled and the following auth_backends: ' +
3737 } )
3838
3939 it ( 'can open an AMQP 1.0 connection' , function ( ) {
40- execSync ( "npm run amqp10_roundtriptest -- " + username + " " + password )
40+ console . log ( execSync ( "npm run amqp10_roundtriptest -- " + username + " " + password ) . toString ( ) )
4141
4242 } )
4343
Original file line number Diff line number Diff line change 1- MQTT_PROTOCOL=mqtts
2- RABBITMQ_MQTT_URL=mqtts://rabbitmq:8883
1+ export MQTT_PROTOCOL=mqtts
2+ export RABBITMQ_MQTT_URL=mqtts://rabbitmq:8883
Original file line number Diff line number Diff line change 11export RABBITMQ_SCHEME=https
22export RABBITMQ_HOSTNAME=rabbitmq
33export RABBITMQ_HOST=rabbitmq:15671
4+ export RABBITMQ_AMQP_SCHEME=amqps
5+ export RABBITMQ_AMQP_PORT=5671
Original file line number Diff line number Diff line change 11export RABBITMQ_SCHEME=https
22export RABBITMQ_HOSTNAME=localhost
33export RABBITMQ_HOST=localhost:15671
4+ export RABBITMQ_AMQP_SCHEME=amqps
5+ export RABBITMQ_AMQP_PORT=5671
6+
Original file line number Diff line number Diff line change 1515 secure =" true"
1616 clientAuth =" false"
1717 sslProtocol =" TLS"
18- keystoreFile =" /uaa/uaa .jks"
18+ keystoreFile =" /uaa/server_uaa .jks"
1919 keystoreType =" PKCS12"
2020 keyAlias =" uaa-tls"
2121 keystorePass =" foobar"
You can’t perform that action at this time.
0 commit comments