Closed einsitang closed 9 years ago
The question has bothered me for a long time, but I don't know how to solve
someone help me?
Ubuntu
System , but on my Mac
, is not work , still errorUndefined symbols for architecture x86_64:
"_SSLv2_client_method", referenced from:
boost::asio::ssl::context::context(boost::asio::ssl::context_base::method) in libsioclient_tls.a(sio_client_impl.cpp.o)
"_SSLv2_method", referenced from:
boost::asio::ssl::context::context(boost::asio::ssl::context_base::method) in libsioclient_tls.a(sio_client_impl.cpp.o)
"_SSLv2_server_method", referenced from:
boost::asio::ssl::context::context(boost::asio::ssl::context_base::method) in libsioclient_tls.a(sio_client_impl.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I just change your code src/internal/sio_client_impl.cpp
line : 568
ctx->set_options(boost::asio::ssl::context::default_workarounds |
/*boost::asio::ssl::context::no_sslv2 |*/
boost::asio::ssl::context::single_dh_use,ec);
if(ec)
{
cerr<<"Init tls failed,reason:"<< ec.message()<<endl;
}
is boost::asio::ssl::context::no_sslv2
on Mac can’t build , but I don’t know why !!
can u tell me that reason ? @melode11
I'm getting stuck in the problem when I try to connect a "https" or "wss" website.
I did this: /_boost::asio::ssl::context::nosslv2 |/ as you said but it didn't work. (I test it on ubuntu 12.04)
g++ -Wall -g -std=c++0x -o client client.cpp -I../build/include/ -I/usr/include/boost ../build/lib/Release/libboost_system.a ../build/lib/Release/libsioclient.a ../build/lib/Release/libsioclient_tls.a ../build/lib/Release/libboost_random.a -lboost_system -lboost_thread -lpthread
My code:
...
sio::client h;
connection_listener l(h);
h.set_open_listener(std::bind(&connection_listener::on_connected, &l));
h.set_close_listener(std::bind(&connection_listener::on_close, &l,std::placeholders::_1));
h.set_fail_listener(std::bind(&connection_listener::on_fail, &l));
//h.connect("https://192.168.168.24:443");
h.connect("wss://meshblu.octoblu.com:443/socket.io/");
...
Error reports:
[2015-12-30 16:14:45] [connect] Successful connection
[2015-12-30 16:14:45] [error] handle_read_http_response error: websocketpp.transport:7 (End of File)
[2015-12-30 16:14:52] [connect] Successful connection
[2015-12-30 16:14:54] [error] handle_read_http_response error: websocketpp.transport:7 (End of File)
[2015-12-30 16:15:02] [connect] Successful connection
[2015-12-30 16:15:03] [error] handle_read_http_response error: websocketpp.transport:7 (End of File)
[2015-12-30 16:15:14] [connect] Successful connection
[2015-12-30 16:15:14] [error] handle_read_http_response error: websocketpp.transport:7 (End of File)
[2015-12-30 16:15:32] [connect] Successful connection
[2015-12-30 16:15:32] [error] handle_read_http_response error: websocketpp.transport:7 (End of File)
[2015-12-30 16:15:32] [info] Error getting remote endpoint: system:107 (Transport endpoint is not connected)
@forfuns Did you ever get an answer? @melode11 Running the CMake generates an OSX build, how do you generate a iOS build?
@rgross2 @forfuns @melode11 I'm still having this issue. Has anyone solved this? Thanks.
@nwestbury No, I had to redo large parts of my project to allow for swift version.... Sorry.
@eternaltao I facing same error. I am trying to connect https server. [connect] Successful connection [error] handle_read_http_response error: websocketpp.transport:7 (End of File)
Can you please help? Thanks
[connect] Successful connection [error] handle_read_http_response error: websocketpp.transport:7 (End of File)
this problem is also exist...
@forfuns refer to this: https://stackoverflow.com/questions/15602113/cannot-link-with-boost-in-mac-os-x-with-clang-c11
my socket.io server use SSL , and I need build a socket.io cpp client to connect server with SSL.
I try build sioclient_tls like this:
then , create two static lib ("
libsioclient.a
andlibsioclient_tls.a
") and “build” directoryso ,I use
build/lib/Release
lib andbuild/include
header file andlibsioclient_tls.a
lib to make my cpp-client project!but , can’t work , so many error in the logs , can’t build .
so , I use
libsoclient.a
to replacelibsioclient_tls.a
and compile is pass . but can’t connect the socket.io server with ssl
P.S.
when I use socket.io javascript client ,use https://xxxx to connect server is success.