@@ -502,6 +502,27 @@ validate_ldap_configuration_via_api(Config) ->
502502 ? assertEqual (<<" unprocessable_entity" >>, maps :get (<<" error" >>, LongPasswordJson )),
503503 ? assertEqual (<<" invalid LDAP credentials: authentication failure" >>,
504504 maps :get (<<" reason" >>, LongPasswordJson )),
505+
506+ % % SSL/TLS Edge Cases
507+ % % Both use_ssl and use_starttls set to true - TLS configuration error
508+ {ok , {{_ , 422 , _ }, _Headers5 , BothTlsBody }} =
509+ rabbit_mgmt_test_util :req (Config , 0 , put , " /ldap/validate/simple-bind" ,
510+ [rabbit_mgmt_test_util :auth_header (" guest" , " guest" )],
511+ rabbit_mgmt_test_util :format_for_upload (#{
512+ 'user_dn' => AliceUserDN ,
513+ 'password' => Password ,
514+ 'servers' => [" localhost" ],
515+ 'port' => LdapTlsPort ,
516+ 'use_ssl' => true ,
517+ 'use_starttls' => true ,
518+ 'ssl_options' => #{
519+ 'cacertfile' => CaCertfile
520+ }
521+ })),
522+ BothTlsJson = rabbit_json :decode (BothTlsBody ),
523+ ? assertEqual (<<" unprocessable_entity" >>, maps :get (<<" error" >>, BothTlsJson )),
524+ ? assertEqual (<<" TLS configuration error: cannot use StartTLS on an SSL connection (use_ssl and use_starttls cannot both be true)" >>,
525+ maps :get (<<" reason" >>, BothTlsJson )),
505526 http_put (Config , " /ldap/validate/simple-bind" ,
506527 #{
507528 'user_dn' => AliceUserDN ,
0 commit comments