Skip to content

Commit

Permalink
Support for building with OpenSSL when OPENSSL_NO_SSL3 is defined.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskohlhoff committed Dec 10, 2015
1 parent 073b294 commit bae401b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions include/boost/asio/ssl/impl/context.ipp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ context::context(context::method m)
handle_ = ::SSL_CTX_new(::SSLv2_server_method()); handle_ = ::SSL_CTX_new(::SSLv2_server_method());
break; break;
#endif // defined(OPENSSL_NO_SSL2) #endif // defined(OPENSSL_NO_SSL2)
#if defined(OPENSSL_NO_SSL3)
case context::sslv3:
case context::sslv3_client:
case context::sslv3_server:
boost::asio::detail::throw_error(
boost::asio::error::invalid_argument, "context");
break;
#else // defined(OPENSSL_NO_SSL3)
case context::sslv3: case context::sslv3:
handle_ = ::SSL_CTX_new(::SSLv3_method()); handle_ = ::SSL_CTX_new(::SSLv3_method());
break; break;
Expand All @@ -98,6 +106,7 @@ context::context(context::method m)
case context::sslv3_server: case context::sslv3_server:
handle_ = ::SSL_CTX_new(::SSLv3_server_method()); handle_ = ::SSL_CTX_new(::SSLv3_server_method());
break; break;
#endif // defined(OPENSSL_NO_SSL3)
case context::tlsv1: case context::tlsv1:
handle_ = ::SSL_CTX_new(::TLSv1_method()); handle_ = ::SSL_CTX_new(::TLSv1_method());
break; break;
Expand Down
8 changes: 8 additions & 0 deletions include/boost/asio/ssl/old/detail/openssl_context_service.hpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ class openssl_context_service
impl = ::SSL_CTX_new(::SSLv2_server_method()); impl = ::SSL_CTX_new(::SSLv2_server_method());
break; break;
#endif // defined(OPENSSL_NO_SSL2) #endif // defined(OPENSSL_NO_SSL2)
#if defined(OPENSSL_NO_SSL3)
case context_base::sslv3:
case context_base::sslv3_client:
case context_base::sslv3_server:
boost::asio::detail::throw_error(boost::asio::error::invalid_argument);
break;
#else // defined(OPENSSL_NO_SSL3)
case context_base::sslv3: case context_base::sslv3:
impl = ::SSL_CTX_new(::SSLv3_method()); impl = ::SSL_CTX_new(::SSLv3_method());
break; break;
Expand All @@ -94,6 +101,7 @@ class openssl_context_service
case context_base::sslv3_server: case context_base::sslv3_server:
impl = ::SSL_CTX_new(::SSLv3_server_method()); impl = ::SSL_CTX_new(::SSLv3_server_method());
break; break;
#endif // defined(OPENSSL_NO_SSL3)
case context_base::tlsv1: case context_base::tlsv1:
impl = ::SSL_CTX_new(::TLSv1_method()); impl = ::SSL_CTX_new(::TLSv1_method());
break; break;
Expand Down

0 comments on commit bae401b

Please sign in to comment.