[erlang-questions] Working with Cuttlefish

code wiget codewiget95@REDACTED
Wed Jul 12 22:42:03 CEST 2017

Hello everyone,

Right now I am working on configuring EMQ support for PSKs. My first goal was to create a client/server that used psks, which is now operational. The biggest part of this was being able to pass ssl:listen the correct parameters, specifically {ciphers, [{ciphers, [{psk, aes_256_cbc, sha}]},{user_lookup_fun, {fun user_lookup/3, ?PskSharedSecret}}, where the shared secret is binary.

Now that that is complete, the big task has been enabling it on EMQ, and to do this it was necessary to pass the correct SslOpts from the config file. So, I modified the emq.schema like so:

SslOpts = fun(Prefix) ->
	Filter([{versions, Versions},
		{ciphers, {psk, aes_256_cbc, sha}},

	But If I set the next line to :
		{user_lookup_fun, {fun user_lookup/3, ?PskSharedSecret}}

	the schema parser fails, it can’t parse this.

How could I write this so that it would be parsed? Or if anyone has any tips or a reference I would also greatly appreciate that, as I am hitting a brick wall.

Thank you for your time.

More information about the erlang-questions mailing list