Boost logo

Boost :

From: Scott (cheesy4poofs_at_[hidden])
Date: 2006-11-02 11:07:14

I've been testing our server for robustness by attempting invalid
connections to it. If the server is running without SSL and a client
attempts to connect via SSL, then the connection is basically refused and
everything is fine.

However, if the server is SSL and the client attempts a non-SSL connection,
problems start to appear. On the first attempt, everything *seems* to be
fine. The client gets a connection closed message (end of file) and the
server closes the connection because of a failed SSL handshake.

On the 2nd attempt, things go really bad. Inside the server session
constructor, the attempt to create a SSL context fails on

        typedef boost::asio::ssl::context Context;
        typedef boost::shared_ptr<Context> ContextPtr;
        sslContext = nw::Connection::ContextPtr(
                new nw::Connection::Context(ioservice,
                        | boost::asio::ssl::context::no_sslv2
                        | boost::asio::ssl::context::single_dh_use);

A boost::error is thrown with a code of 10022, "An invalid argument was
supplied". It's basically happening in openssl_context_service.hpp:

    if (::SSL_CTX_use_certificate_chain_file(impl, filename.c_str()) != 1)
      boost::asio::error e(boost::asio::error::invalid_argument);

However, it's the exact same arguments I used previously that worked fine.

Call Stack:

         msvcr71.dll!__crtExitProcess(int status=2089872920) Line 463 + 0x9
         msvcr71.dll!free(void * pBlock=0x0012f714) Line 103 C
> NwEngineD.exe!boost::throw_exception<boost::asio::error>(const
boost::asio::error & e={...}) Line 40 C++
ror>() Line 49 + 0x9 C++
cate_chain_file<boost::asio::detail::throw_error_t>() Line 215 C++
boost::asio::detail::throw_error_t>() Line 127 C++
std::basic_string<char,std::char_traits<char>,std::allocator<char> > &
filename={...}) Line 271 C++

Any help would be greatly appreciated.


Boost list run by bdawes at, gregod at, cpdaniel at, john at