1 (edited by bthoms01 2017-10-13 06:23:22)

Topic: "unknown record type in hdr" error

After integrating the wolfSSL library into our embedded web server, I getting an "unknown record type in hdr" error when my server thread makes its first call to wolfSSL_read(). I don't know what this error is telling me.

There is no file system on my platform so I've had to embed the CA and server certificates in the code, but they seem to work with the echo server/echo client tutorial that I've ported onto the same platform.

I'm using the ca_cert_der_1024, server_cert_der_1024, and the server_key_der_1024 certificates that are included with the WolfSSL library. My user_settings.h file is attached.

Thanks,
Brad Thomson

Post's attachments

user_settings.h 4.84 kb, 1 downloads since 2017-10-13 

You don't have the permssions to download the attachments of this post.

Share

Re: "unknown record type in hdr" error

Hi bthoms01,

Usually this error means there was an issue placing network bytes into the read buffer.

You have `MQX_USE_IO_OLD` defined which causes the wolfio.c to use the old MQX RTCS. You might try adding some debug in the IO and doing a Wireshark trace.

Another option is to enable and set IO callbacks where you can handle the socket read/writes directly. To do this define `WOLFSSL_USER_IO` and set IO callbacks using:
WOLFSSL_API void wolfSSL_SetIORecv(WOLFSSL_CTX *ctx, CallbackIORecv CBIORecv);
WOLFSSL_API void wolfSSL_SetIOSend(WOLFSSL_CTX *ctx, CallbackIOSend CBIOSend);

You can find an example for this here:
https://github.com/wolfSSL/wolfssl-exam … ack.c#L194

If you don't require support for pre TLS 1.2 I'd recommend adding `NO_OLD_TLS`.

Let me know if that information is helpful or if you have any other questions.

Thanks,
David Garske, wolfSSL

Share