Sporadic SSL error 140940F6 (unknown warning type) when using SSL_shutdown on server

I have a relatively simple SSL multithreaded server and clients similar to a webserver / client.

This whole setup works mostly fine, however clients sporadically fail with an SSL handshake with the following error:

SSL Error 336150774: error:140940F6:SSL routines:SSL3_READ_BYTES:unknown alert type

      

This happens, seemingly randomly, once every 20-100 connections and subsequent reconnections. The server uses OpenSSL 1.0.1i, which I compiled from the official source (on Windows) without any configuration. We have a variety of clients, including non-OpenSSL clients, that exhibit the same behavior. There are no errors on the server side that I can tell. A web search for these errors has not yielded anything useful yet. If there is only one client at a time, no error occurs.

Things I've tried so far:

  • various SSL options like session caching
  • CRYPTO_set_locking_callback is already installed on both servers and clients (without this, the server usually falls apart at some point under heavy load)
  • serialize SSL_accept and SSL_shutdown on the server so only one happens at a time
  • various protocol options (all defaults, TLSv1 only, etc.)

None of this helps. Clients still get the error above. The only thing that helps is to exclude SSL_shutdown () on the server side. This fixes the error, however it results in a slow but steady leaking of handles on the server, which would not otherwise occur.

What am I doing wrong?

+3


source to share





All Articles