Hi,
I tried to follow the documentation for ssl in boost::asio
(Overview/SSL), coming up with a few lines of code which fail to compile
with boost-1.36 (gcc-4.2.4, Ubuntu8.04, 64bit) with the following message:
sslTest.cpp:13: error: invalid initialization of reference of type
‘boost::asio::basic_stream_socketboost::asio::ip::tcp >&’ from
expression of type ‘boost::asio::basic_socketboost::asio::ip::tcp >’
The message is pretty clear, but I have no idea yet how to fix the problem.
Here is the code:
// -----------------------------------------
#include
#include
using namespace std;
using namespace boost::asio;
int main()
{
io_service ioService;
ssl::context ctx(ioService, ssl::context::sslv23);
ssl::streamip::tcp::socket sslSock(ioService, ctx);
ip::tcp::socket& sock = sslSock.lowest_layer();
}
// -----------------------------------------
Regards,
Roland