Skip to content

How to print mbed tls debug messages in MBED ? #4985

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

Closed
LMESTM opened this issue Aug 29, 2017 · 4 comments
Closed

How to print mbed tls debug messages in MBED ? #4985

LMESTM opened this issue Aug 29, 2017 · 4 comments

Comments

@LMESTM
Copy link
Contributor

LMESTM commented Aug 29, 2017

Question

I'd like to see outputs of MBEDTLS macros like MBEDTLS_SSL_DEBUG_MSG.
Has this been plugged into MBED trace module and if so how do I activate it ?

@LMESTM
Copy link
Contributor Author

LMESTM commented Aug 29, 2017

@RonEld @adustm maybe you guys know how to do it ?

@adustm
Copy link
Member

adustm commented Aug 29, 2017

Hello Laurent, you can see an example here :
https://github.com/ARMmbed/mbed-os-example-tls/blob/5cca1f74a70855c17cf292f176d0c96db4980df9/tls-client/main.cpp#L48

The debug level is between 0 (nothing) and 4 (every details)

@LMESTM
Copy link
Contributor Author

LMESTM commented Aug 29, 2017

Thanks @adustm .
So to summarize in this ticket, in order to debug MBEDTLS in mbed we need the program to:

  • include mbedtls/debug.h
  • define a debug callback (my_debug in the provided example)
  • then register this callabck and activate the desired threshold with mbedtls API:
    mbedtls_ssl_conf_dbg(&_ssl_conf, my_debug, NULL);
    mbedtls_debug_set_threshold(DEBUG_LEVEL);

@moustafabessar
Copy link

It doesn't work on matlab mex file
I tried to run the client1.c example on mex file and IT WORKS but debug doesn't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants