Topic: 308 Error in wolfSSL_accept()
Hi,
my aim is to establish a CoAP Server with DTLS over UDP on an Arduino MKR1000. I used microcoap for CoAP and a given example UDP implementation from Arduino. To enable DTLS I followed the wolfSSL DTLS Server example
I merged this example to the UDP implementation from Arduino. Before this I ported wolfssl to the Arduino and implemented the random and xtime function.
My problem is, that the handshake fails, when I establish a connection with a CoAPS client to my CoAP server. On the server I get the UDP package and I could parse it. But when I call wolfSSL_accept(ssl) it returns -1 and the error code is 308 - SOCKET_ERROR_E. The ssl parameter is not null. The source of the error is, when the following method gets called in internal.c:
in = Receive(ssl,
ssl->buffers.inputBuffer.buffer +
ssl->buffers.inputBuffer.length,
inSz);
if (in == -1)
return SOCKET_ERROR_E;
Why did I get this error?
Thanks,
Thomas