@@ -45,6 +45,7 @@ groups() ->
4545 {activemq , [], shared ()},
4646 {rabbitmq_strict , [], [
4747 basic_roundtrip_tls ,
48+ roundtrip_tls_global_config ,
4849 open_connection_plain_sasl ,
4950 open_connection_plain_sasl_failure ,
5051 open_connection_plain_sasl_parse_uri
@@ -281,6 +282,26 @@ basic_roundtrip_tls(Config) ->
281282 sasl => ? config (sasl , Config )},
282283 roundtrip (OpnConf ).
283284
285+ % % ssl option validation fails if verify_peer is enabled without cacerts.
286+ % % Test that cacertfile option takes effect taken from the application env.
287+ roundtrip_tls_global_config (Config ) ->
288+ Hostname = ? config (rmq_hostname , Config ),
289+ Port = rabbit_ct_broker_helpers :get_node_config (Config , 0 , tcp_port_amqp_tls ),
290+ CACertFile = ? config (rmq_certsdir , Config ) ++ " /testca/cacert.pem" ,
291+ CertFile = ? config (rmq_certsdir , Config ) ++ " /client/cert.pem" ,
292+ KeyFile = ? config (rmq_certsdir , Config ) ++ " /client/key.pem" ,
293+ ok = application :set_env (amqp10_client , ssl_options , [{cacertfile , CACertFile },
294+ {certfile , CertFile },
295+ {keyfile , KeyFile }]),
296+ OpnConf = #{address => Hostname ,
297+ port => Port ,
298+ tls_opts => {secure_port , [{verify , verify_peer }]},
299+ notify => self (),
300+ container_id => <<" open_connection_tls_container" >>,
301+ sasl => ? config (sasl , Config )},
302+ roundtrip (OpnConf ),
303+ application :unset_env (amqp10_client , ssl_options ).
304+
284305service_bus_config (Config , ContainerId ) ->
285306 Hostname = ? config (sb_endpoint , Config ),
286307 Port = ? config (sb_port , Config ),
0 commit comments