|
Boost : |
From: Scott (cheesy4poofs_at_[hidden])
Date: 2006-06-13 08:04:19
Hello,
Our group has created a fairly sophisticated client/server system using ASIO
from sourceforge. First off, I would just like to thank the developer(s)
for a fantastic library! It greatly simplifies asychronous networking code.
My problem lies with retrofitting SSL into our current codebase. We now
have the requirement that the end user should be able to specify whether to
use SSL or not. So I've been trying to understand and add SSL support....it
hasn't gone well so far.
Background:
I'm compiling with MSVS 7.1 on Windows XP SP2.
If someone coulld answer my initial questions, I would greatly appreciate
it! :)
1) Are there any tutorials and/or best practices documentation for SSL with
ASIO? I haven't found any. The most I've found is some client/server
classes that use SSL in libs\asio\example\ssl. Unfortunately, the code
doesn't seem to compile without editing because it references the
boost::asio namespace and the asio library is currently just in the asio
namespace. So, I question how current the example code is.
2) I started to replace our socket code that used asio::stream_socket with
asio::ssl::stream<asio::stream_socket>. I added the asio::ssl::context
object to the socket constructor, but I'm now getting compile errors like
this:
..\API\inc\asio\ssl\detail\openssl_operation.hpp(368) : error C2039:
'read_some' : is not a member of 'asio'
..\API\inc\asio\ssl\detail\openssl_operation.hpp(367) : while
compiling class-template member function 'int
asio::ssl::detail::openssl_operation<Stream>::do_sync_read(void)'
with
[
Stream=asio::stream_socket
]
..\API\inc\asio\ssl\detail\openssl_stream_service.hpp(359) : see
reference to class template instantiation
'asio::ssl::detail::openssl_operation<Stream>' being compiled
with
[
Stream=asio::stream_socket
]
..\API\inc\asio\ssl\stream_service.hpp(143) : see reference to
function template instantiation 'size_t
asio::ssl::detail::openssl_stream_service<Allocator>::read_some<Stream,Mutab
le_Buffers,Error_Handler>(asio::ssl::detail::openssl_stream_service<Allocato
r>::impl_type & ,Stream &,const Mutable_Buffers &,Error_Handler)' being
compiled
with
[
Allocator=std::allocator<void>,
Stream=asio::stream_socket,
Mutable_Buffers=asio::detail::consuming_buffers<asio::mutable_buffer_contain
er_1>,
Error_Handler=asio::detail::assign_error_t<asio::ssl::stream<asio::stream_so
cket>::error_type>
]
..\API\inc\asio\ssl\stream.hpp(389) : see reference to function
template instantiation 'size_t
asio::ssl::stream_service<>::read_some<Stream,Mutable_Buffers,Error_Handler>
(asio::ssl::stream_service<>::impl_type & ,Stream &,const Mutable_Buffers
&,Error_Handler)' being compiled
...
<snip>
Anyway, I'll stop here for now. Any pointers on SSL with ASIO would be
greatly appreciated!
Thanks,
Scott
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk