Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

SSL_R_SHORT_READ undefined in openssl-1.1 #599

Closed
LocutusOfBorg opened this issue Nov 1, 2016 · 10 comments
Closed

SSL_R_SHORT_READ undefined in openssl-1.1 #599

LocutusOfBorg opened this issue Nov 1, 2016 · 10 comments

Comments

@LocutusOfBorg
Copy link
Contributor

Hi, seems that variable disappeared from new openssl, and it makes websocketpp fail to build with the new one. I tried to understand the asio change chriskohlhoff/asio@7249bcc
but I probably failed.
Attached a patch that makes it build, but I honestly don't know what does it mean :)

--- websocketpp-0.7.0.orig/websocketpp/transport/asio/security/tls.hpp
+++ websocketpp-0.7.0/websocketpp/transport/asio/security/tls.hpp
@@ -355,8 +355,13 @@ protected:
     template <typename ErrorCodeType>
     lib::error_code translate_ec(ErrorCodeType ec) {
         if (ec.category() == lib::asio::error::get_ssl_category()) {
+#if defined SSL_R_SHORT_READ
             if (ERR_GET_REASON(ec.value()) == SSL_R_SHORT_READ) {
                 return make_error_code(transport::error::tls_short_read);
+#else
+            if (ERR_GET_REASON(ec.value()) == boost::asio::ssl::error::stream_truncated) {
+                return make_error_code(boost::asio::ssl::error::stream_truncated);
+#endif
LocutusOfBorg added a commit to LocutusOfBorg/websocketpp that referenced this issue Nov 1, 2016
This might fix issue zaphoyd#599, but I have no clues about what does it mean
LocutusOfBorg added a commit to LocutusOfBorg/websocketpp that referenced this issue Nov 1, 2016
This might fix issue zaphoyd#599, but I have no clues about what does it mean
LocutusOfBorg pushed a commit to LocutusOfBorg/websocketpp that referenced this issue Nov 2, 2016
LocutusOfBorg pushed a commit to LocutusOfBorg/websocketpp that referenced this issue Nov 2, 2016
@jeremyong
Copy link

+1 this issue is a blocker in adopting OpenSSL 1.1

@LocutusOfBorg
Copy link
Contributor Author

the patch is already in Debian BTW
LocutusOfBorg@1dd0711

dk1027 added a commit to dk1027/websocketpp that referenced this issue Dec 30, 2016
@leetal
Copy link

leetal commented Feb 7, 2017

This also blocks for using BoringSSL

RafaelFontes added a commit to RafaelFontes/websocketpp that referenced this issue Mar 23, 2017
@LocutusOfBorg
Copy link
Contributor Author

this is the commit to take
LocutusOfBorg@1dd0711

@xgdgsc
Copy link

xgdgsc commented Apr 30, 2017

@LocutusOfBorg Thanks. I tried adding the patch to websocketpp on archlinux , now it builds fine, but shows the following test error:

test/extension/permessage_deflate.cpp(555): error: in "compress_data_large": check v.ec == websocketpp::lib::error_code() has failed [websocketpp.extension.permessage-deflate:8 != system:0]
test/extension/permessage_deflate.cpp(558): error: in "compress_data_large": check v.ec == websocketpp::lib::error_code() has failed [websocketpp.extension.permessage-deflate:8 != system:0]
test/extension/permessage_deflate.cpp(559): error: in "compress_data_large": check compress_in == decompress_out has failed [************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************ != ]

*** 3 failures are detected in the test module "permessage_deflate"
scons: *** [test] Error 201
scons: building terminated because of errors.
==> ERROR: A failure occurred in check().
    Aborting...

Do those tests matter?

@LocutusOfBorg
Copy link
Contributor Author

How did you enable such test?
I use

-DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON

and I don't seem to run it...

        make -j4 test ARGS\+=-j4
make[1]: Entering directory '/build/websocketpp-0.7.0/obj-x86_64-linux-gnu'
Running tests...
/usr/bin/ctest --force-new-ctest-process -j4
Test project /build/websocketpp-0.7.0/obj-x86_64-linux-gnu
      Start  1: test_connection
      Start  2: test_endpoint
      Start  3: test_http
      Start  4: test_logger
 1/24 Test  #4: test_logger ..........................   Passed    0.00 sec
 2/24 Test  #2: test_endpoint ........................   Passed    0.02 sec
 3/24 Test  #1: test_connection ......................   Passed    0.03 sec
 4/24 Test  #3: test_http ............................   Passed    0.02 sec
      Start  5: test_message_buffer
      Start  6: test_processor
      Start  7: test_processor_hybi00
      Start  8: test_processor_hybi07
 5/24 Test  #7: test_processor_hybi00 ................   Passed    0.01 sec
 6/24 Test  #8: test_processor_hybi07 ................   Passed    0.01 sec
 7/24 Test  #6: test_processor .......................   Passed    0.02 sec
 8/24 Test  #5: test_message_buffer ..................   Passed    0.02 sec
      Start  9: test_processor_hybi08
      Start 10: test_random_none
      Start 11: test_random_random_device
      Start 12: test_roles_client
 9/24 Test  #9: test_processor_hybi08 ................   Passed    0.01 sec
10/24 Test #11: test_random_random_device ............   Passed    0.00 sec
11/24 Test #10: test_random_none .....................   Passed    0.01 sec
12/24 Test #12: test_roles_client ....................   Passed    0.01 sec
      Start 13: test_roles_server
      Start 14: test_transport_asio_security
      Start 15: test_transport_iostream_base
      Start 16: test_transport_iostream_endpoint
13/24 Test #13: test_roles_server ....................   Passed    0.02 sec
14/24 Test #16: test_transport_iostream_endpoint .....   Passed    0.01 sec
15/24 Test #15: test_transport_iostream_base .........   Passed    0.02 sec
16/24 Test #14: test_transport_asio_security .........   Passed    0.02 sec
      Start 17: test_transport_iostream_connection
      Start 18: test_transport_asio_base
      Start 19: test_close
      Start 20: test_error
17/24 Test #17: test_transport_iostream_connection ...   Passed    0.01 sec
18/24 Test #18: test_transport_asio_base .............   Passed    0.01 sec
19/24 Test #19: test_close ...........................   Passed    0.01 sec
20/24 Test #20: test_error ...........................   Passed    0.01 sec
      Start 21: test_frame
      Start 22: test_sha1
      Start 23: test_uri
      Start 24: test_utilities
21/24 Test #21: test_frame ...........................   Passed    0.02 sec
22/24 Test #24: test_utilities .......................   Passed    0.01 sec
23/24 Test #23: test_uri .............................   Passed    0.02 sec
24/24 Test #22: test_sha1 ............................   Passed    0.02 sec

100% tests passed, 0 tests failed out of 24

@xgdgsc
Copy link

xgdgsc commented Apr 30, 2017

I use https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=websocketpp-git , the test is enabled with scons test. Anyway I commented out test, and for now it runs fine.

@LocutusOfBorg
Copy link
Contributor Author

mmm I don't have that test failing

/build/websocketpp-0.7.0/build/test/utility/test_uri_boost
Running 20 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/utility/test_utility_boost
Running 5 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/utility/test_frame
Running 20 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/utility/test_close_boost
Running 6 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/utility/test_sha1_boost
Running 3 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/utility/test_error_boost
Running 1 test case...

*** No errors detected
/build/websocketpp-0.7.0/build/test/utility/test_utility_stl
Running 5 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/utility/test_uri_stl
Running 20 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/utility/test_close_stl
Running 6 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/utility/test_sha1_stl
Running 3 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/utility/test_error_stl
Running 1 test case...

*** No errors detected
/build/websocketpp-0.7.0/build/test/http/test_http_boost
Running 41 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/http/test_http_stl
Running 41 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/logger/logger_basic_boost
Running 5 test cases...
[2017-04-30 16:06:03] [info] Information

*** No errors detected
/build/websocketpp-0.7.0/build/test/logger/logger_basic_stl
Running 5 test cases...
[2017-04-30 16:06:03] [info] Information

*** No errors detected
/build/websocketpp-0.7.0/build/test/random/test_random_none_boost
Running 1 test case...

*** No errors detected
/build/websocketpp-0.7.0/build/test/random/test_random_device_boost
Running 1 test case...
1236759713

*** No errors detected
/build/websocketpp-0.7.0/build/test/random/test_random_none_stl
Running 1 test case...

*** No errors detected
/build/websocketpp-0.7.0/build/test/random/test_random_device_stl
Running 1 test case...
1710021639

*** No errors detected
/build/websocketpp-0.7.0/build/test/processors/test_processor_boost
Running 10 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/processors/test_hybi13_boost
Running 36 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/processors/test_hybi08_boost
Running 6 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/processors/test_hybi07_boost
Running 6 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/processors/test_hybi00_boost
Running 12 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/processors/test_extension_permessage_compress_boost
Running 1 test case...

*** No errors detected
/build/websocketpp-0.7.0/build/test/processors/test_processor_stl
Running 10 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/processors/test_hybi13_stl
Running 36 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/processors/test_hybi08_stl
Running 6 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/processors/test_hybi07_stl
Running 6 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/processors/test_hybi00_stl
Running 12 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/processors/test_extension_permessage_compress_stl
Running 1 test case...

*** No errors detected
/build/websocketpp-0.7.0/build/test/message_buffer/test_message_boost
Running 2 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/message_buffer/test_alloc_boost
Running 2 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/message_buffer/test_message_stl
Running 2 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/message_buffer/test_alloc_stl
Running 2 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/extension/test_extension_boost
Running 1 test case...

*** No errors detected
/build/websocketpp-0.7.0/build/test/extension/test_permessage_deflate_boost
Running 43 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/extension/test_extension_stl
Running 1 test case...

*** No errors detected
/build/websocketpp-0.7.0/build/test/extension/test_permessage_deflate_stl
Running 43 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/transport/iostream/test_iostream_base_boost
Running 1 test case...

*** No errors detected
/build/websocketpp-0.7.0/build/test/transport/iostream/test_iostream_connection_boost
Running 25 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/transport/iostream/test_iostream_endpoint_boost
Running 1 test case...

*** No errors detected
/build/websocketpp-0.7.0/build/test/transport/iostream/test_iostream_base_stl
Running 1 test case...

*** No errors detected
/build/websocketpp-0.7.0/build/test/transport/iostream/test_iostream_connection_stl
Running 25 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/transport/iostream/test_iostream_endpoint_stl
Running 1 test case...

*** No errors detected
/build/websocketpp-0.7.0/build/test/transport/asio/test_base_boost
Running 2 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/transport/asio/test_timers_boost
Running 1 test case...

*** No errors detected
/build/websocketpp-0.7.0/build/test/transport/asio/test_security_boost
Running 2 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/transport/asio/test_base_stl
Running 2 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/transport/asio/test_timers_stl
Running 1 test case...

*** No errors detected
/build/websocketpp-0.7.0/build/test/transport/asio/test_security_stl
Running 2 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/roles/test_client_boost
Running 7 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/roles/test_server_boost
Running 8 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/roles/test_client_stl
Running 7 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/roles/test_server_stl
Running 8 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/endpoint/test_endpoint_boost
Running 8 test cases...
[2017-04-30 16:06:05] [info] asio listen error: system:98 (Address already in use)

*** No errors detected
/build/websocketpp-0.7.0/build/test/endpoint/test_endpoint_stl
Running 8 test cases...
[2017-04-30 16:06:05] [info] asio listen error: system:98 (Address already in use)

*** No errors detected
/build/websocketpp-0.7.0/build/test/connection/test_connection_boost
Running 17 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/connection/test_connection_stl
Running 17 test cases...

*** No errors detected
/build/websocketpp-0.7.0/build/test/transport/test_boost_integration
Running 14 test cases...
[2017-04-30 16:06:12] [connect] WebSocket Connection iostream transport v13 "" / 101

*** No errors detected
/build/websocketpp-0.7.0/build/test/transport/test_stl_integration
Running 14 test cases...
[2017-04-30 16:06:18] [connect] WebSocket Connection iostream transport v13 "" / 101

*** No errors detected
scons: done building targets.

I have to disable some test_transport because of some port already taken, but not the one failing for you.

@xeroc
Copy link

xeroc commented Feb 14, 2018

This issue is blocking an upgrade to openssl-1.1 compatibility for BitShares which could be resolved by merging
LocutusOfBorg@1dd0711
int 0.7.0 tag.

Any chance we can get this done?

xeroc pushed a commit to bitshares/websocketpp that referenced this issue Feb 14, 2018
@abitmore
Copy link

@xeroc check this comment for more info:

zaphoyd commented on Jun 12, 2017
A fix for this in theory has been committed to develop branch.

IoanCosminSzanto pushed a commit to IoanCosminSzanto/websocketpp that referenced this issue Mar 5, 2018
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

7 participants