RESTinio
Loading...
Searching...
No Matches
restinio::socket_type_dependent_settings_t< Settings, tls_socket_t > Class Template Reference

Customizes extra settings needed for working with socket. More...

#include <tls.hpp>

Public Member Functions

 socket_type_dependent_settings_t ()=default
 socket_type_dependent_settings_t (socket_type_dependent_settings_t &&)=default
Settings & tls_context (asio_ns::ssl::context context) &
 Setup an exclusive TLS-context for server's settings.
Settings && tls_context (asio_ns::ssl::context context) &&
 Setup an exclusive TLS-context for server's settings.
Settings & tls_context (std::shared_ptr< asio_ns::ssl::context > shared_context) &
 Setup a shared TLS-context for server's settings.
Settings && tls_context (std::shared_ptr< asio_ns::ssl::context > shared_context) &&
 Setup a shared TLS-context for server's settings.
std::shared_ptr< asio_ns::ssl::context > giveaway_tls_context ()
 Get away the TLS-context from settings.
socket_type_dependent_settings_toperator= (const socket_type_dependent_settings_t &) noexcept=default

Protected Member Functions

 ~socket_type_dependent_settings_t ()=default

Private Member Functions

Settings & upcast_reference ()

Private Attributes

std::shared_ptr< asio_ns::ssl::context > m_tls_context

Detailed Description

template<typename Settings>
class restinio::socket_type_dependent_settings_t< Settings, tls_socket_t >

Customizes extra settings needed for working with socket.

Adds tls context setting.

Definition at line 189 of file tls.hpp.

Constructor & Destructor Documentation

◆ ~socket_type_dependent_settings_t()

template<typename Settings>
restinio::socket_type_dependent_settings_t< Settings, tls_socket_t >::~socket_type_dependent_settings_t ( )
protecteddefault

◆ socket_type_dependent_settings_t() [1/2]

template<typename Settings>
restinio::socket_type_dependent_settings_t< Settings, tls_socket_t >::socket_type_dependent_settings_t ( )
default

◆ socket_type_dependent_settings_t() [2/2]

template<typename Settings>
restinio::socket_type_dependent_settings_t< Settings, tls_socket_t >::socket_type_dependent_settings_t ( socket_type_dependent_settings_t< Settings, tls_socket_t > && )
default

Member Function Documentation

◆ giveaway_tls_context()

template<typename Settings>
std::shared_ptr< asio_ns::ssl::context > restinio::socket_type_dependent_settings_t< Settings, tls_socket_t >::giveaway_tls_context ( )
inline

Get away the TLS-context from settings.

Note
This method is intended to be used by RESTinio's internals.
Since
v.0.6.10

Definition at line 302 of file tls.hpp.

◆ operator=()

◆ tls_context() [1/4]

template<typename Settings>
Settings & restinio::socket_type_dependent_settings_t< Settings, tls_socket_t >::tls_context ( asio_ns::ssl::context context) &
inline

Setup an exclusive TLS-context for server's settings.

Definition at line 201 of file tls.hpp.

◆ tls_context() [2/4]

template<typename Settings>
Settings && restinio::socket_type_dependent_settings_t< Settings, tls_socket_t >::tls_context ( asio_ns::ssl::context context) &&
inline

Setup an exclusive TLS-context for server's settings.

Definition at line 211 of file tls.hpp.

◆ tls_context() [3/4]

template<typename Settings>
Settings & restinio::socket_type_dependent_settings_t< Settings, tls_socket_t >::tls_context ( std::shared_ptr< asio_ns::ssl::context > shared_context) &
inline

Setup a shared TLS-context for server's settings.

This method can be used when several servers should share the same TLS context. Or if TLS should be shared with some other entity in an application.

Example:

auto tls_context = std::make_shared< asio::ssl::context >(
asio::ssl::context::sslv23 );
... // Tuning of tls_context.
first_settings.address( "localhost" );
first_settings.port( 443 );
first_settings.tls_context( tls_context );
...
restinio::server_settings_t< traits_t > second_settings;
second_settings.address( "localhost" );
second_settings.port( 5553 );
second_settings.tls_context( tls_context );
...
Derived & port(std::uint16_t p) &
Server endpoint.
Definition settings.hpp:585
Derived & address(std::string addr) &
Definition settings.hpp:642
A fluent style interface for setting http server params.
Settings & tls_context(asio_ns::ssl::context context) &
Setup an exclusive TLS-context for server's settings.
Definition tls.hpp:201
tls_traits_t< asio_timer_manager_t, null_logger_t > default_tls_traits_t
Definition tls.hpp:152
Since
v.0.6.10

Definition at line 247 of file tls.hpp.

◆ tls_context() [4/4]

template<typename Settings>
Settings && restinio::socket_type_dependent_settings_t< Settings, tls_socket_t >::tls_context ( std::shared_ptr< asio_ns::ssl::context > shared_context) &&
inline

Setup a shared TLS-context for server's settings.

This method can be used when several servers should share the same TLS context. Or if TLS should be shared with some other entity in an application.

Example:

auto tls_context = std::make_shared< asio::ssl::context >(
asio::ssl::context::sslv23 );
... // Tuning of tls_context.
auto first_server = restinio::run_async< traits_t >(
.address( "localhost" )
.port( 443 )
4u );
auto second_server = restinio::run_async< traits_t >(
.address( "localhost" )
.port( 5553 )
4u );
running_server_handle_t< Traits > run_async(io_context_holder_t io_context, server_settings_t< Traits > &&settings, std::size_t thread_pool_size)
Creates an instance of HTTP-server and launches it on a separate thread or thread pool.
io_context_holder_t own_io_context()
Function which tells that http_server should create and use its own instance of io_context.
Since
v.0.6.10

Definition at line 288 of file tls.hpp.

◆ upcast_reference()

template<typename Settings>
Settings & restinio::socket_type_dependent_settings_t< Settings, tls_socket_t >::upcast_reference ( )
inlineprivate

Definition at line 309 of file tls.hpp.

Member Data Documentation

◆ m_tls_context

template<typename Settings>
std::shared_ptr< asio_ns::ssl::context > restinio::socket_type_dependent_settings_t< Settings, tls_socket_t >::m_tls_context
private
Initial value:
{
std::make_shared< asio_ns::ssl::context >(
asio_ns::ssl::context::sslv23 )
}

Definition at line 314 of file tls.hpp.


The documentation for this class was generated from the following file: