@@ -315,3 +315,119 @@ fun(Conf) ->
315315 Value -> Value
316316 end
317317end}.
318+
319+
320+ %%
321+ %% TLS client options
322+ %%
323+
324+ {mapping, "cluster_formation.consul.ssl_options", "rabbit.cluster_formation.peer_discovery_consul.ssl_options", [
325+ {datatype, {enum, [none]}}
326+ ]}.
327+
328+ {translation, "rabbit.cluster_formation.peer_discovery_consul.ssl_options",
329+ fun(Conf) ->
330+ case cuttlefish:conf_get("cluster_formation.consul.ssl_options", Conf, undefined) of
331+ none -> [];
332+ _ -> cuttlefish:invalid("Invalid cluster_formation.consul.ssl_options")
333+ end
334+ end}.
335+
336+ {mapping, "cluster_formation.consul.ssl_options.verify", "rabbit.cluster_formation.peer_discovery_consul.ssl_options.verify", [
337+ {datatype, {enum, [verify_peer, verify_none]}}]}.
338+
339+ {mapping, "cluster_formation.consul.ssl_options.fail_if_no_peer_cert", "rabbit.cluster_formation.peer_discovery_consul.ssl_options.fail_if_no_peer_cert", [
340+ {datatype, {enum, [true, false]}}]}.
341+
342+ {mapping, "cluster_formation.consul.ssl_options.cacertfile", "rabbit.cluster_formation.peer_discovery_consul.ssl_options.cacertfile",
343+ [{datatype, string}, {validators, ["file_accessible"]}]}.
344+
345+ {mapping, "cluster_formation.consul.ssl_options.certfile", "rabbit.cluster_formation.peer_discovery_consul.ssl_options.certfile",
346+ [{datatype, string}, {validators, ["file_accessible"]}]}.
347+
348+ {mapping, "cluster_formation.consul.ssl_options.cacerts.$name", "rabbit.cluster_formation.peer_discovery_consul.ssl_options.cacerts",
349+ [{datatype, string}]}.
350+
351+ {translation, "rabbit.cluster_formation.peer_discovery_consul.ssl_options.cacerts",
352+ fun(Conf) ->
353+ Settings = cuttlefish_variable:filter_by_prefix("cluster_formation.consul.ssl_options.cacerts", Conf),
354+ [ list_to_binary(V) || {_, V} <- Settings ]
355+ end}.
356+
357+ {mapping, "cluster_formation.consul.ssl_options.cert", "rabbit.cluster_formation.peer_discovery_consul.ssl_options.cert",
358+ [{datatype, string}]}.
359+
360+ {translation, "rabbit.cluster_formation.peer_discovery_consul.ssl_options.cert",
361+ fun(Conf) ->
362+ list_to_binary(cuttlefish:conf_get("cluster_formation.consul.ssl_options.cert", Conf))
363+ end}.
364+
365+ {mapping, "cluster_formation.consul.ssl_options.crl_check", "rabbit.cluster_formation.peer_discovery_consul.ssl_options.crl_check",
366+ [{datatype, [{enum, [true, false, peer, best_effort]}]}]}.
367+
368+ {mapping, "cluster_formation.consul.ssl_options.depth", "rabbit.cluster_formation.peer_discovery_consul.ssl_options.depth",
369+ [{datatype, integer}, {validators, ["byte"]}]}.
370+
371+ {mapping, "cluster_formation.consul.ssl_options.dh", "rabbit.cluster_formation.peer_discovery_consul.ssl_options.dh",
372+ [{datatype, string}]}.
373+
374+ {translation, "rabbit.cluster_formation.peer_discovery_consul.ssl_options.dh",
375+ fun(Conf) ->
376+ list_to_binary(cuttlefish:conf_get("cluster_formation.consul.ssl_options.dh", Conf))
377+ end}.
378+
379+ {mapping, "cluster_formation.consul.ssl_options.dhfile", "rabbit.cluster_formation.peer_discovery_consul.ssl_options.dhfile",
380+ [{datatype, string}, {validators, ["file_accessible"]}]}.
381+
382+ {mapping, "cluster_formation.consul.ssl_options.key.RSAPrivateKey", "rabbit.cluster_formation.peer_discovery_consul.ssl_options.key",
383+ [{datatype, string}]}.
384+
385+ {mapping, "cluster_formation.consul.ssl_options.key.DSAPrivateKey", "rabbit.cluster_formation.peer_discovery_consul.ssl_options.key",
386+ [{datatype, string}]}.
387+
388+ {mapping, "cluster_formation.consul.ssl_options.key.PrivateKeyInfo", "rabbit.cluster_formation.peer_discovery_consul.ssl_options.key",
389+ [{datatype, string}]}.
390+
391+ {translation, "rabbit.cluster_formation.peer_discovery_consul.ssl_options.key",
392+ fun(Conf) ->
393+ case cuttlefish_variable:filter_by_prefix("cluster_formation.consul.ssl_options.key", Conf) of
394+ [{[_,_,Key], Val}|_] -> {list_to_atom(Key), list_to_binary(Val)};
395+ _ -> undefined
396+ end
397+ end}.
398+
399+ {mapping, "cluster_formation.consul.ssl_options.keyfile", "rabbit.cluster_formation.peer_discovery_consul.ssl_options.keyfile",
400+ [{datatype, string}, {validators, ["file_accessible"]}]}.
401+
402+ {mapping, "cluster_formation.consul.ssl_options.log_alert", "rabbit.cluster_formation.peer_discovery_consul.ssl_options.log_alert",
403+ [{datatype, {enum, [true, false]}}]}.
404+
405+ {mapping, "cluster_formation.consul.ssl_options.password", "rabbit.cluster_formation.peer_discovery_consul.ssl_options.password",
406+ [{datatype, string}]}.
407+
408+ {mapping, "cluster_formation.consul.ssl_options.psk_identity", "rabbit.cluster_formation.peer_discovery_consul.ssl_options.psk_identity",
409+ [{datatype, string}]}.
410+
411+ {mapping, "cluster_formation.consul.ssl_options.reuse_sessions", "rabbit.cluster_formation.peer_discovery_consul.ssl_options.reuse_sessions",
412+ [{datatype, {enum, [true, false]}}]}.
413+
414+ {mapping, "cluster_formation.consul.ssl_options.secure_renegotiate", "rabbit.cluster_formation.peer_discovery_consul.ssl_options.secure_renegotiate",
415+ [{datatype, {enum, [true, false]}}]}.
416+
417+ {mapping, "cluster_formation.consul.ssl_options.versions.$version", "rabbit.cluster_formation.peer_discovery_consul.ssl_options.versions",
418+ [{datatype, atom}]}.
419+
420+ {translation, "rabbit.cluster_formation.peer_discovery_consul.ssl_options.versions",
421+ fun(Conf) ->
422+ Settings = cuttlefish_variable:filter_by_prefix("cluster_formation.consul.ssl_options.versions", Conf),
423+ [V || {_, V} <- Settings]
424+ end}.
425+
426+ {mapping, "cluster_formation.consul.ssl_options.ciphers.$cipher", "rabbit.cluster_formation.peer_discovery_consul.ssl_options.ciphers",
427+ [{datatype, string}]}.
428+
429+ {translation, "rabbit.cluster_formation.peer_discovery_consul.ssl_options.ciphers",
430+ fun(Conf) ->
431+ Settings = cuttlefish_variable:filter_by_prefix("cluster_formation.consul.ssl_options.ciphers", Conf),
432+ lists:reverse([V || {_, V} <- Settings])
433+ end}.
0 commit comments