Add getters for SSLListener's and SSLSocket's SSLContext member
This commit is contained in:
parent
1ae3523fe2
commit
5215d5aca0
@ -81,6 +81,20 @@ namespace fr
|
|||||||
*/
|
*/
|
||||||
int32_t get_socket_descriptor() const override;
|
int32_t get_socket_descriptor() const override;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Gets the ssl context
|
||||||
|
*
|
||||||
|
* @return The SSLContext
|
||||||
|
*/
|
||||||
|
const std::shared_ptr<SSLContext> &get_ssl_context()const;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Gets the ssl context
|
||||||
|
*
|
||||||
|
* @return The SSLContext
|
||||||
|
*/
|
||||||
|
std::shared_ptr<SSLContext> &get_ssl_context();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
mbedtls_net_context listen_fd;
|
mbedtls_net_context listen_fd;
|
||||||
mbedtls_ssl_config conf;
|
mbedtls_ssl_config conf;
|
||||||
|
|||||||
@ -126,6 +126,20 @@ namespace fr
|
|||||||
return is_blocking;
|
return is_blocking;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Gets the ssl context
|
||||||
|
*
|
||||||
|
* @return The SSLContext
|
||||||
|
*/
|
||||||
|
const std::shared_ptr<SSLContext> &get_ssl_context()const;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Gets the ssl context
|
||||||
|
*
|
||||||
|
* @return The SSLContext
|
||||||
|
*/
|
||||||
|
std::shared_ptr<SSLContext> &get_ssl_context();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Checks to see if we're connected to a socket or not
|
* Checks to see if we're connected to a socket or not
|
||||||
*
|
*
|
||||||
@ -151,4 +165,4 @@ namespace fr
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //FRNETLIB_SSLSOCKET_H
|
#endif //FRNETLIB_SSLSOCKET_H
|
||||||
|
|||||||
@ -171,9 +171,19 @@ namespace fr
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::shared_ptr<SSLContext> &SSLListener::get_ssl_context()const
|
||||||
|
{
|
||||||
|
return ssl_context;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<SSLContext> &SSLListener::get_ssl_context()
|
||||||
|
{
|
||||||
|
return ssl_context;
|
||||||
|
}
|
||||||
|
|
||||||
bool SSLListener::connected() const
|
bool SSLListener::connected() const
|
||||||
{
|
{
|
||||||
return listen_fd.fd > -1;
|
return listen_fd.fd > -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -284,9 +284,17 @@ namespace fr
|
|||||||
return -1;
|
return -1;
|
||||||
return ssl_socket_descriptor->fd;
|
return ssl_socket_descriptor->fd;
|
||||||
}
|
}
|
||||||
|
const std::shared_ptr<SSLContext> &SSLSocket::get_ssl_context()const
|
||||||
|
{
|
||||||
|
return ssl_context;
|
||||||
|
}
|
||||||
|
std::shared_ptr<SSLContext> &SSLSocket::get_ssl_context()
|
||||||
|
{
|
||||||
|
return ssl_context;
|
||||||
|
}
|
||||||
|
|
||||||
bool SSLSocket::connected() const
|
bool SSLSocket::connected() const
|
||||||
{
|
{
|
||||||
return ssl_socket_descriptor && ssl_socket_descriptor->fd > -1;
|
return ssl_socket_descriptor && ssl_socket_descriptor->fd > -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user