Re: [asio-users] Error context: asio.ssl:336539714
Brought to you by:
chris_kohlhoff
From: Kasper L. <la...@st...> - 2022-06-21 11:16:44
|
On 21/06/2022 12.34, Sorin Cernescu via asio-users wrote: > Hello, > > I designed a shared library(boost 1.78 , g++ 4.8.5) containing a method like this: > void f() > { > try > { > boost::asio::ssl::context ctx(boost::asio::ssl::context::sslv23); > } > catch(std::exception& e) > { > cout<<"exception depicted as: "<<e.what(); > } > cout<<"OKAY"; > } > > Then I test my library from the same machine in two different ways: > > a) It works ok when calling this method from a cprogram with dlopen() ( output: "OKAY") > b) From a custome application, if I load this library and then I call the same method, I have this output "exception depicted as: context: asio.ssl error [asio.ssl:336539714]" > > Any thought, please? > Some thoughts that haven't really been well investigated. OpenSSL error codes (which is what asio.ssl errors really are) can be quite tricky to deal with. It can sometimes be helpful to use the OpenSSL command line tool with the errstr command. There isn't a corresponding error string for 336539714, but converting it to hex gives: ❯ openssl errstr 140f3042 error:140F3042:SSL routines:func(243):called a function you should not call Which sounds more reasonable but still not very helpful. Then I noticed you are attempting to use sslv23. SSL in general is deprecated and version 2.3 of SSL is very deprecated which sounds like it might fit with the error string. Are you simply trying to use SSL v2.3 with a version of OpenSSL that has deprecated/disabled that protocol (as it should be)? Hope that helps a bit. Kind regards, Kasper Laudrup |