Topic: wolfssl_shutdown hanging when terminating dlts 1.0 client connection

I have a wolfssl client that is connecting to a dtls 1.0 server over a UDP connection.  I am working on connectivity/stability of the connection, so am doing various things including cable disconnects, server on/off, etc..

During the cleanup, I am calling wolfss_shutdown(ssl) in a while loop, checking the return value for WOLFSSL_SHUTDOWN_NOT_DONE.  First time through it returns WOLFSSL_SHUTDOWN_NOT_DONE.  Second time it hangs and never exits or returns (or at least not in the first few minutes).

Any suggestions as to what might be happening?  Is there some timeout value that I can set?

  I'm doing this per the various DTLS examples in github. 

Thanks!

Share

Re: wolfssl_shutdown hanging when terminating dlts 1.0 client connection

Hi bp787

Are you trying to do a bi-directional shutdown?

Does the server respond with anything after the first shutdown? Do you have a pcap of the interaction?

Thanks,
Eric - wolfSSL Support

Re: wolfssl_shutdown hanging when terminating dlts 1.0 client connection

I will attempt to get a pcap of the interaction soon.

I only get the WOLFSSL_SHUTDOWN_NOT_DONE return from the server after the first call.  As soon as I can, I will run a capture on the interaction. 

I'm am 100% unsure if I need to do a bidirectional shutdown, but I was having a few occasional hangs previously and added this in as good measure.  That said, I found the issues for the other hangs and maybe I no longer need or want this.

Is there a case where a bi-drectional shutdown is not desired?

Share

Re: wolfssl_shutdown hanging when terminating dlts 1.0 client connection

Servers often do not support bidirectional shutdown, instead just silently closing the connection.

In the case of DTLS, a time out while waiting for the close notify could be used to handle the case of a non-responding server.

Re: wolfssl_shutdown hanging when terminating dlts 1.0 client connection

Thanks!  I'll look into adding a timeout function.

Share