Hoe to debug TLS with client authentication?

Hi,

I’m in the process of debugging TLS with client authentication.

I have the erlang debugger() running, and at some point in the validation proces (more precisely in ssl_handshake apply_user_fun/ 7 line 2065) a callback is to be made into my elixir code.

Now the Fun looks like this in the debugger: < Fun = #Fun<Elixir.TalqGw.5.111646411>

Is there a way to find exactly which function is referenced by the numbers .5.111646411 ?

Also I have followed the guides here:
https://www.erlang.org/doc/apps/debugger/debugger_chapter.html
and

To get the debug session running, and as it is an erlang debugger, it cannot step into elixir code (makes sense)
But is there another elixir debugger I can start up in parallel to make that possible?

Cheers
Søren

1 Like

I have never attached a debugged for TLS troubleshooting, so if there is an answer there I’d also be interested

What I usually do is add log_level: :debug to the SSL options (both client and server if you have access to each). That gives me a sense of where it is breaking.

From there, I use Extrace (or just plain recon) to get logs of the calls to specific functions. I’ll set this multiple times based on my discovery to add or remove functions to trace. One I have the calls including the function arguments, I start comparing with the OTP source. So very manual, but works well TLS.

In your case, I’d start with Extrace.call({: ssl_handshake, :apply_user_fun, :_}, 100, scope: :local, return_to: true

1 Like