[erlang-questions] SSL/TLS transport customization

Geoff Cant nem@REDACTED
Sat Jun 15 00:17:23 CEST 2013


Will this support be something like a new stdlib module akin to (the API of) https://github.com/extend/ranch/blob/master/src/ranch_transport.erl ? (maybe call them stream_transport and dgram_transport)

Once something like this existed, I'd be highly tempted to write all my libraries to use stream_transport - it'd save re-inventing it all the time. Hopefully the following people would be able to delete some code too:

* Ranch
  https://github.com/extend/ranch/blob/master/src/ranch_transport.erl
  https://github.com/extend/ranch/blob/master/src/ranch_tcp.erl
  https://github.com/extend/ranch/blob/master/src/ranch_ssl.erl

* Hackney
  https://github.com/benoitc/hackney/blob/master/src/hackney_tcp_transport.erl
  https://github.com/benoitc/hackney/blob/master/src/hackney_ssl_transport.erl

* Mochiweb
  https://github.com/mochi/mochiweb/blob/master/src/mochiweb_socket.erl

* Inets ;p
  https://github.com/erlang/otp/blob/master/lib/inets/src/http_lib/http_transport.erl

* lhttpc
  https://github.com/esl/lhttpc/blob/master/src/lhttpc_sock.erl

* Misultin
  https://github.com/ostinelli/misultin/blob/master/src/misultin_socket.erl

* RabbitMQ (and common library)
  https://github.com/mkurkov/rabbit_common/blob/master/src/rabbit_net.erl

* Stomperl
  https://github.com/mplatov/stomperl/blob/master/src/socket_wrapper.erl

* Open Server Platform
  https://github.com/ranok/open-server-platform/blob/master/src/osp_socket.erl

I could go on :)

Cheers,
--
Geoff Cant

On 2013-06-14, at 14:51 , Ingela Andin <ingela.andin@REDACTED> wrote:

> Due to an issue that came up on the EUC, I just want to clearify that the
> Erlang ssl application now (even before R16B01) will let you customize the
> transport protocol in such a way that you do not need to use the
> inet-driver. From the documentation:
> 
> "transportoption() = {cb_info, {CallbackModule::atom(), DataTag::atom(),
> ClosedTag::atom(), ErrTag:atom()}} - defaults to {gen_tcp, tcp, tcp_closed,
> tcp_error}. Can be used to customize the transport layer. The callback
> module must implement a reliable transport protocol and behave as gen_tcp
> and in addition have functions corresponding to inet:setopts/2,
> inet:getopts/2, inet:peername/1, inet:sockname/1 and inet:port/1. The
> callback gen_tcp is treated specially and will call inet directly."
> 
> We plan to formalize the API and extend the documentation of it, but it is
> there now and can be used.
> 
> Regards Ingela Erlang/OTP team - Ericsson AB
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions









More information about the erlang-questions mailing list