Topic: PIC32MZ controller restart during SSL handshake
Hi,
I am just getting started with WolfSSL library in MPLAB Harmony v2.06 using PIC32MZ curiosity development board with MRF24WN Wi-Fi module. During the negotiation phase, pic32mz controller gets restarted. Kindly help to find root cause and suggest solution.
Below are some checks in place:
I have extended the demo project to connect to https://test.mosquitto.org/ over secured port 8883.
I have downloaded PEM certificate file from official website (http://test.mosquitto.org/), converted to ASCII and loaded using buffer.
Below are some configuration details:
#define MICROCHIP_MPLAB_HARMONY
#define MICROCHIP_TCPIP
#define MICROCHIP_PIC32
#define WOLFSSL_HAVE_MIN
#define WOLFSSL_HAVE_MAX
#define MICROCHIP_PIC32_RNG
#define NEED_AES_TABLES
#define SIZEOF_LONG_LONG 8
#define WOLFSSL_USER_IO
#define NO_WRITEV
#define NO_DEV_RANDOM
#define NO_FILESYSTEM
#define WOLFSSL_STATIC_RSA
#define SINGLE_THREADED
#define USE_FAST_MATH
#define TFM_TIMING_RESISTANT
#define NO_WOLFSSL_SERVER
#define NO_DES3
#define NO_MD4
#define NO_RC4
#define NO_RABBIT
#define NO_HC128
#define HAVE_AESGCM
#define DEBUG_WOLFSSL
#define NO_OLD_TLS
#define WOLFSSL_TRUST_PEER_CERT
Below is the console log
>openurl https://test.mosquitto.org/
>Connecting to host
Connection Opened: Starting SSL Negotiation
Waiting for completion of secure negotiation
wolfSSL (2): wolfSSL Entering WOLFSSL_CTX_new_ex
wolfSSL (2): wolfSSL Entering wolfSSL_CertManagerNew
wolfSSL (2): wolfSSL Entering wolfSSL_CTX_load_verify_buffer
wolfSSL (1): Adding a CA
wolfSSL (2): wolfSSL Entering GetExplicitVersion
wolfSSL (2): wolfSSL Entering GetSerialNumber
wolfSSL (1): Got Cert Header
wolfSSL (2): wolfSSL Entering GetAlgoId
wolfSSL (2): wolfSSL Entering GetObjectId()
wolfSSL (1): Got Algo ID
wolfSSL (1): Getting Cert Name
wolfSSL (1): Getting Cert Name
wolfSSL (1): Got Subject Name
wolfSSL (2): wolfSSL Entering GetAlgoId
wolfSSL (2): wolfSSL Entering GetObjectId()
wolfSSL (1): Got Key
wolfSSL (1): Parsed Past Key
wolfSSL (2): wolfSSL Entering DecodeCertExtensions
wolfSSL (2): wolfSSL Entering GetObjectId()
wolfSSL (2): wolfSSL Entering GetAlgoId
wolfSSL (1): Freeing der CA
wolfSSL (2): wolfSSL Entering GetExplicitVersion
wolfSSL (2): wolfSSL Entering GetObjectId()
wolfSSL (1): Got Subject Name
wolfSSL (1): Parsed Past Key
wolfSSL (2): wolfSSL Entering GetObjectId()
wolfSSL (2): wolfSSL Entering GetAlgoId
wolfSSL (1): Freeing der trusted peer cert
wolfSSL (2): wolfSSL Entering SSL_set_fd
wolfSSL (1): growing output buffer
wolfSSL (2): wolfSSL Entering SSL_connect()
wolfSSL (2): wolfSSL Entering SSL_connect()
wolfSSL (2): wolfSSL Entering SSL_get_error
wolfSSL (2): wolfSSL Entering SSL_get_error
wolfSSL (2): wolfSSL Entering DoHandShakeMsg()
wolfSSL (1): growing input buffer
wolfSSL (1): processing server hello
wolfSSL (2): wolfSSL Entering SSL_connect()
wolfSSL (2): wolfSSL Entering SSL_connect()
After this, the controller restarts.
P.S.: I have deleted repeated console debug output messages.