Bug 1449163
Summary: | tls.hpp, SSL_R_SHORT_READ undefined in openssl-1.1 | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | c72578 | ||||||
Component: | websocketpp | Assignee: | Fabian Affolter <mail> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | unspecified | ||||||||
Version: | rawhide | CC: | acooks, c72578, mail, rdieter | ||||||
Target Milestone: | --- | Keywords: | Triaged | ||||||
Target Release: | --- | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | websocketpp-0.7.0-5.fc26 | Doc Type: | If docs needed, set a value | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2017-06-09 19:01:45 UTC | Type: | Bug | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 1440704 | ||||||||
Attachments: |
|
Description
c72578
2017-05-09 10:49:39 UTC
websocketspp has no such calls, I think you meant to file this against libwebsockets instead The affected file tls.hpp is part of the package websocketpp-devel. e.g.: dnf repoquery -l websocketpp-devel | grep security/tls.hpp /usr/include/websocketpp/transport/asio/security/tls.hpp Here is the correct link for the reported upstream websocketpp issue: https://github.com/zaphoyd/websocketpp/issues/599 The patch file, which is supposed to fix the issue of tls.hpp in Fedora >=26 will be attached here too. PS: The above link under "Additional info:" was the wrong one - sorry. Created attachment 1277427 [details] Patch to fix SSL_R_SHORT_READ undefined in openssl-1.1 Patch from https://github.com/zaphoyd/websocketpp/issues/599 PR: https://github.com/zaphoyd/websocketpp/pull/600 websocketpp test packages, which include the suggested patch, have been created using Fedora copr for F26 and rawhide: https://copr.fedorainfracloud.org/coprs/c72578/websocketpp/ Spec URL: https://raw.githubusercontent.com/c72578/rpmbuild/master/SPECS/websocketpp.spec SRPM URL: https://copr-be.cloud.fedoraproject.org/results/c72578/websocketpp/fedora-26-x86_64/00551039-websocketpp/websocketpp-0.7.0-4.fc26.src.rpm * Fri May 12 2017 Wolfgang Stöggl <c72578> - 0.7.0-4 - Added websocketpp-Fix-issue-599.patch Fixes compilation errors in F26 etc., which contain openssl >= 1.1 SSL_R_SHORT_READ undefined in openssl-1.1 Here is a simpler/different procedure to reproduce this issue with tls.hpp from websocketpp 0.7.0: Steps to Reproduce: 1. Carry out the following steps under Fedora 26, which includes openssl 1.1.0e 2. Make sure, that the following packages are installed sudo dnf install cmake openssl-devel 2. Get websocketcpp source from here: e.g. websocket-0.7.0 from: https://github.com/zaphoyd/websocketpp/archive/0.7.0.tar.gz or using git (preferred): git clone https://github.com/zaphoyd/websocketpp.git 3. Carry out the following commands: cd websocketpp mkdir build cd build cmake .. -DBUILD_EXAMPLES=ON -DBUILD_TESTS=ON make -j4 4. The error message appears under Fedora 26, which uses the newer openssl 1.1.0e Remark: The error does not appear, when carrying out above steps under Fedora 25, which has openssl 1.0.2k. Actual results: websocketpp/transport/asio/security/tls.hpp:358:47: error: 'SSL_R_SHORT_READ' was not declared in this scope if (ERR_GET_REASON(ec.value()) == SSL_R_SHORT_READ) { ^~~~~~~~~~~~~~~~ Expected results: No error Additional info: SSL_R_SHORT_READ undefined in openssl-1.1 https://github.com/zaphoyd/websocketpp/issues/599 A suggestion for a patch is found there and attached to this bug report. websocketpp test packages, which include the suggested patch, have been created using Fedora copr for F26 and rawhide: https://copr.fedorainfracloud.org/coprs/c72578/websocketpp/ Spec URL: https://raw.githubusercontent.com/c72578/rpmbuild/master/SPECS/websocketpp.spec SRPM URL: https://copr-be.cloud.fedoraproject.org/results/c72578/websocketpp/fedora-26-x86_64/00551039-websocketpp/websocketpp-0.7.0-4.fc26.src.rpm Sorry, my grepping in my original comment was insufficient, but I am a little surprised since websocketpp packaging currently has no direct dependencies on openssl nor do we build examples or tests but I suppose this error may get caught at buildtime if we did build tests, I'll look into it. The initial case, where the error turned up, was when trying to build C++ REST SDK under Fedora 26 or rawhide. This package depends on websocketpp-devel and openssl-devel (see review request at https://bugzilla.redhat.com/show_bug.cgi?id=1440704). The unit tests of websocketpp itself seemed to be the simpler way to test and reproduce the 'SSL_R_SHORT_READ' error here. websocketpp-0.7.0-4.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-39d3695b69 websocketpp-0.7.0-4.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-39d3695b69 In the test package websocketpp-0.7.0-4.fc26, the following is missing in the spec file: BuildRequires: openssl-devel Reason: openssl support of websocketpp is be required from my side. See the related build log, which shows, that OPENSSL is missing: https://kojipkgs.fedoraproject.org//packages/websocketpp/0.7.0/4.fc26/data/logs/noarch/build.log -- OPENSSL_FOUND = FALSE -- OPENSSL_INCLUDE_DIR = OPENSSL_INCLUDE_DIR-NOTFOUND -- OPENSSL_LIBRARIES = OPENSSL_SSL_LIBRARY-NOTFOUND;OPENSSL_CRYPTO_LIBRARY-NOTFOUND -- OPENSSL_VERSION = And when building websocketpp-0.7.0-4.fc26 with openssl-devel the following error occurs now (coming from websocketpp-0.7.0-openssl11.patch) instead of the previous one: /builddir/build/BUILD/websocketpp-0.7.0/test/transport/asio/security.cpp:65:6: required from here /builddir/build/BUILD/websocketpp-0.7.0/websocketpp/transport/asio/security/tls.hpp:363:39: error: could not convert 'boost::asio::ssl::error::make_error_code((boost::asio::ssl::error::stream_errors)1)' from 'boost::system::error_code' to 'std::error_code' return make_error_code(boost::asio::ssl::error::stream_truncated); ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ It's simply now an invalid test, that probably should be fixed too. Is your dependant software/package affected too? Yes, the dependent package cpprest is affected in the same way. FWIW: C++11 and Boost both have an error_code class, but they cannot be used interchangeably despite their close resemblance: http://breese.github.io/2016/06/18/unifying-error-codes.html However, it works with the patch, which is attached to this bug report. The attached patch simply removes the "if (ERR_GET_REASON(ec.value()) == SSL_R_SHORT_READ)"... and does not add "if (ERR_GET_REASON(ec.value()) == boost::asio::ssl::error::stream_truncated) { return make_error_code(boost::asio::ssl::error::stream_truncated);" which does not work because of the differences between boost and std error code. OK. FYI, the patch attached to this report is IMO unacceptable too, since it changes behavior for when using openssl < 1.1 But I can adjust it to be conditional whether SSL_R_SHORT_READ is defined or not. (Would be nice if websocketpp upstream would agree on a proper fix too, instead of having to guess) I agree with adjusting it conditional for now as a workaround. Later on an upstream fix should be the solution. websocketpp-0.7.0-5.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-39d3695b69 websocketpp-0.7.0-5.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-39d3695b69 websocketpp-0.7.0-5.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report. Created attachment 1287445 [details]
Patch to fix SSL_R_SHORT_READ undefined in openssl-1.1
Finally used version of the patch in websocketpp-0.7.0-5.fc26.
Adjusted to be conditional whether SSL_R_SHORT_READ is defined or not.
|