Maybe a more generic solution would be if Transport behaviour would have an optional format_error callback and ranch_ssl would implement it calling ssl:format_error.
Not sure which one is preferred?
As an example the below crash happens if a non-existing cipher is provided in the options (seen with Erlang 26.2.5)
According to the
ranch_transport
behaviour,listen/1
callback should return only atoms as error reasons https://github.com/ninenines/ranch/blob/master/src/ranch_transport.erl#L31. Howeverssl:listen
and henceranch_ssl:listen/1
can return more sophisticated error reasons as visible inssl:format_error/1
.A quick fix would be to use
ssl:format_error
instead ofinet:format_error
in (https://github.com/ninenines/ranch/blob/a8f31f3f0274f7e5a6b58fa6b6090c3160c4d023/src/ranch_acceptors_sup.erl#L114) (the former fall back to the later so works for non-ssl connections too)Maybe a more generic solution would be if Transport behaviour would have an optional
format_error
callback andranch_ssl
would implement it callingssl:format_error
.Not sure which one is preferred?
As an example the below crash happens if a non-existing cipher is provided in the options (seen with Erlang 26.2.5)