Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-4559

TSSLServerSocket incorrectly prints errors

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.11.0
    • 0.12.0
    • C++ - Library
    • Ubuntu Linux 16.04 with Thrift 0.11.0 and libssl-dev 1.0.2g

    • Patch Available
    • Patch

    Description

      Tested on both 0.11.0 and master.

       

      C++ Server, Python Client. SSL sockets. SSL works correctly and communication is successful, however when the client disconnects the server always prints the following message:

      Thrift: Tue Apr 17 15:43:36 2018 TConnectedClient died: SSL_read: error code: 0 (SSL_error_code = 5)

       

      Deeper diving shows that SSL_error_code 5 is SSL_ERROR_SYSCALL. Documentation says to check both errno and the SLL error stack, however upon inspection both return 0 (no error). I believe this message is printed incorrectly.

       

      Upon inspecting the code for handing SSL_read, it appears that reading is done in a while-loop, which if no error is found is broken out of. At some point a switch-case was added, but the single level of break statements remained, leaving non-errors to break out of the switch instead of the while.

       

      A potential fix can be seen here: https://github.com/apache/thrift/pull/1549

      Attachments

        1. 0001-maybe-fixes-things.patch
          2 kB
          Sidney Borne

        Activity

          People

            jking3 James E. King III
            sidneys1 Sidney Borne
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: