fix(cuttlefish-schema): parse IP addr for SSL listeners.
Convert IP addr str to tuple to please ranch. Other types of listeners seem me to be happy with the tuple format as well. Closes: #4426
This commit is contained in:
parent
7e3b7bb0fe
commit
8f6f649703
|
@ -2006,19 +2006,18 @@ end}.
|
||||||
{honor_cipher_order, cuttlefish:conf_get(Prefix ++ ".honor_cipher_order", Conf, undefined)}])
|
{honor_cipher_order, cuttlefish:conf_get(Prefix ++ ".honor_cipher_order", Conf, undefined)}])
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
Listen_fix = fun({Ip, Port}) -> case inet:parse_address(Ip) of
|
||||||
|
{ok, R} -> {R, Port};
|
||||||
|
_ -> {Ip, Port}
|
||||||
|
end;
|
||||||
|
(Other) -> Other
|
||||||
|
end,
|
||||||
|
|
||||||
TcpListeners = fun(Type, Name) ->
|
TcpListeners = fun(Type, Name) ->
|
||||||
Prefix = string:join(["listener", Type, Name], "."),
|
Prefix = string:join(["listener", Type, Name], "."),
|
||||||
ListenOnN = case cuttlefish:conf_get(Prefix, Conf, undefined) of
|
ListenOnN = case cuttlefish:conf_get(Prefix, Conf, undefined) of
|
||||||
undefined -> [];
|
undefined -> [];
|
||||||
ListenOn ->
|
ListenOn -> Listen_fix(ListenOn)
|
||||||
case ListenOn of
|
|
||||||
{Ip, Port} ->
|
|
||||||
case inet:parse_address(Ip) of
|
|
||||||
{ok ,R} -> {R, Port};
|
|
||||||
_ -> {Ip, Port}
|
|
||||||
end;
|
|
||||||
Other -> Other
|
|
||||||
end
|
|
||||||
end,
|
end,
|
||||||
[#{ proto => Atom(Type)
|
[#{ proto => Atom(Type)
|
||||||
, name => Name
|
, name => Name
|
||||||
|
@ -2038,7 +2037,7 @@ end}.
|
||||||
ListenOn ->
|
ListenOn ->
|
||||||
[#{ proto => Atom(Type)
|
[#{ proto => Atom(Type)
|
||||||
, name => Name
|
, name => Name
|
||||||
, listen_on => ListenOn
|
, listen_on => Listen_fix(ListenOn)
|
||||||
, opts => [ {deflate_options, DeflateOpts(Prefix)}
|
, opts => [ {deflate_options, DeflateOpts(Prefix)}
|
||||||
, {tcp_options, TcpOpts(Prefix)}
|
, {tcp_options, TcpOpts(Prefix)}
|
||||||
, {ssl_options, SslOpts(Prefix)}
|
, {ssl_options, SslOpts(Prefix)}
|
||||||
|
|
Loading…
Reference in New Issue