Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support TLS/DTLS PSK #2297

merged 6 commits into from Mar 13, 2019


Copy link

terry-xiaoyu commented Mar 11, 2019

  • Trigger an emqx hook tls_handshake.psk_lookup when tls/dtls handshake occurs.
  • Add PSK configurations for listener.ssl, listener.wss and bridge.*.
  • Add a module emqx_psk acting as a PSK lookup proxy towards psk-lookup plugins.
  • Also changed filtered/2 to filter_passed/2 in emqx_hooks.erl, as the former is somewhat counterintuitive.
- PSK handlers can be implemented as independent emqx plugins.
- PSK handlers register themselves to emqx while loading the plugins.
- `psk_from_file` is the built-in and default PSK handler
- Users can select an PSK handler as active via CLI

$ emqx_ctl psk handlers list
psk_from_file   [*]

$ emqx_ctl plugins load psk_from_redis

$ emqx_ctl psk handlers list
psk_from_file   [*]

$ emqx_ctl psk handlers active psk_from_redis

$ emqx_ctl psk handlers list
psk_from_redis  [*]
@terry-xiaoyu terry-xiaoyu requested review from emqplus, tigercl, gilbertwong96 and turtleDeng and removed request for tigercl Mar 11, 2019
lookup(psk, ClientPSKID, UserState) ->
try emqx_hooks:run('tls_handshake.psk_lookup', [ClientPSKID], UserState) of
{ok, SharedSecret} -> {ok, SharedSecret};
{stop, SharedSecret} -> {ok, SharedSecret}

This comment has been minimized.

Copy link

terry-xiaoyu Mar 12, 2019

Author Contributor

case clause

@terry-xiaoyu terry-xiaoyu merged commit 111b661 into develop Mar 13, 2019
1 check failed
1 check failed
continuous-integration/travis-ci/push The Travis CI build failed
@turtleDeng turtleDeng deleted the psk branch Mar 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.