migrating_from_2.0.asciidoc 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. [appendix]
  2. == Migrating from Ranch 2.0 to Ranch 2.1
  3. Ranch 2.1 adds counters and alarms.
  4. The https://github.com/juhlig/prometheus_ranch[Prometheus collector]
  5. was updated to include accepted/terminated connections
  6. metrics.
  7. Ranch 2.1 is compatible with Erlang/OTP 22.0 onward. Support
  8. for Erlang/OTP 21 has been removed.
  9. === Features added
  10. * Metrics are now provided by `ranch:info/0,1`. Currently
  11. includes accepted/terminated connection counts per
  12. connection supervisor.
  13. * Alarms can now be configured. The only alarm currently
  14. available is `num_connections`. When the number of
  15. connections goes over a configurable treshold Ranch
  16. will call the given callback. This can be used to
  17. programmatically shut down idle connections to
  18. make up space for new connections, for example.
  19. * A `post_listen_callback` option has been added. It
  20. receives sockets immediately after the `Transport:listen/1`
  21. call. It can be used for some additional initialization
  22. of the socket, such as setting file permissions on
  23. Unix domain sockets.
  24. * It is now possible to use TLS-PSK authentication
  25. without having to specify a default certificate
  26. for TLS < 1.3.
  27. === Experimental features added
  28. * The `inet_backend` option is now properly handled
  29. and tested for TCP listeners. This allows using
  30. the experimental `socket` backend. The `socket`
  31. backend is now tested with Ranch. Note that
  32. there are known issues and Windows support is not
  33. currently implemented.
  34. === Changed behaviors
  35. * Ranch will now remove unsupported SSL/TLS options
  36. where applicable. A warning will be logged when
  37. this happens. Options are only removed when they
  38. are not compatible with the selected TLS version
  39. and leaving them would prevent the listener from
  40. starting.
  41. +
  42. The following options are removed when using TLS
  43. 1.1, 1.2 or 1.3: `beast_mitigation` and `padding_check`.
  44. +
  45. The following options are removed when using TLS
  46. 1.3 exclusively: `client_renegotiation`,
  47. `next_protocols_advertised`, `psk_identity`,
  48. `reuse_session`, `reuse_sessions`,
  49. `secure_renegotiate` and `user_lookup_fun`.
  50. === Added functions
  51. * The function `ranch_proxy_header:to_connection_info/1`
  52. converts PROXY protocol information to the same
  53. format as `ssl:connection_information/1`. Because
  54. there is little overlap only the `protocol`,
  55. `selected_cipher_suite` and `sni_hostname` will
  56. be available, however.