@@ -66,13 +66,14 @@ sub_groups() ->
6666 ssl_user_vhost_parameter_mapping_success ,
6767 ssl_user_vhost_parameter_mapping_not_allowed ,
6868 ssl_user_vhost_parameter_mapping_vhost_does_not_exist ,
69- ssl_user_cert_vhost_mapping_takes_precedence_over_port_vhost_mapping
69+ ssl_user_cert_vhost_mapping_takes_precedence_over_port_vhost_mpping
7070 ]},
7171 {ssl_user_with_invalid_client_id_in_cert_san_dns , [],
7272 [invalid_client_id_from_cert_san_dns
7373 ]},
7474 {ssl_user_with_client_id_in_cert_san_dns , [],
75- [client_id_from_cert_san_dns
75+ [client_id_from_cert_san_dns ,
76+ ssl_user_password_not_propagated_if_not_provided
7677 ]},
7778 {ssl_user_with_client_id_in_cert_san_dns_1 , [],
7879 [client_id_from_cert_san_dns_1
@@ -81,7 +82,8 @@ sub_groups() ->
8182 [client_id_from_cert_san_email
8283 ]},
8384 {ssl_user_with_client_id_in_cert_dn , [],
84- [client_id_from_cert_dn
85+ [client_id_from_cert_dn ,
86+ ssl_user_password_not_propagated_if_not_provided
8587 ]},
8688 {no_ssl_user , [shuffle ],
8789 [anonymous_auth_failure ,
@@ -338,6 +340,7 @@ init_per_testcase(T, Config)
338340 when T =:= client_id_propagation ;
339341 T =:= invalid_client_id_from_cert_san_dns ;
340342 T =:= client_id_from_cert_san_dns ;
343+ T =:= ssl_user_password_not_propagated_if_not_provided ;
341344 T =:= client_id_from_cert_san_dns_1 ;
342345 T =:= client_id_from_cert_san_email ;
343346 T =:= client_id_from_cert_dn ->
@@ -477,6 +480,7 @@ end_per_testcase(T, Config)
477480 when T =:= client_id_propagation ;
478481 T =:= invalid_client_id_from_cert_san_dns ;
479482 T =:= client_id_from_cert_san_dns ;
483+ T =:= ssl_user_password_not_propagated_if_not_provided ;
480484 T =:= client_id_from_cert_san_dns_1 ;
481485 T =:= client_id_from_cert_san_email ;
482486 T =:= client_id_from_cert_dn ->
@@ -573,6 +577,7 @@ client_id_from_cert_san_email(Config) ->
573577 rabbit_auth_backend_mqtt_mock ,
574578 get ,
575579 [authentication ]),
580+ ct :log (" client_id_from_cert_dn. AuthProps: ~p " , [AuthProps ]),
576581 ? assertEqual (ExpectedClientId , proplists :get_value (client_id , AuthProps )),
577582 ok = emqtt :disconnect (C ).
578583
@@ -584,10 +589,22 @@ client_id_from_cert_dn(Config) ->
584589 [{authentication , AuthProps }] = rpc (Config , 0 ,
585590 rabbit_auth_backend_mqtt_mock ,
586591 get ,
587- [authentication ]),
592+ [authentication ]),
588593 ? assertEqual (ExpectedClientId , proplists :get_value (client_id , AuthProps )),
589594 ok = emqtt :disconnect (C ).
590595
596+ ssl_user_password_not_propagated_if_not_provided (Config ) ->
597+ ExpectedClientId = get_client_cert_subject (Config ), % subject = distinguished_name
598+ MqttClientId = ExpectedClientId ,
599+ {ok , C } = connect_ssl (MqttClientId , Config ),
600+ {ok , _ } = emqtt :connect (C ),
601+ [{authentication , AuthProps }] = rpc (Config , 0 ,
602+ rabbit_auth_backend_mqtt_mock ,
603+ get ,
604+ [authentication ]),
605+ ? assertEqual (false , proplists :is_defined (password , AuthProps )),
606+ ok = emqtt :disconnect (C ).
607+
591608invalid_client_id_from_cert_san_dns (Config ) ->
592609 MqttClientId = <<" other_client_id" >>,
593610 {ok , C } = connect_ssl (MqttClientId , Config ),
0 commit comments