mirror of
https://github.com/EvernodeXRPL/hpcore.git
synced 2026-04-29 15:37:59 +00:00
Added initial TLS support for socket communication (#41)
* Added initial commit * Added tls to web sockets which require key file and cert file * Added meaningful comments
This commit is contained in:
@@ -4,18 +4,21 @@
|
||||
#include <rapidjson/document.h>
|
||||
#include <sodium.h>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include "usr.hpp"
|
||||
#include "user_session_handler.hpp"
|
||||
#include "../sock/socket_server.hpp"
|
||||
#include "../sock/socket_session_handler.hpp"
|
||||
#include "../util.hpp"
|
||||
#include "../conf.hpp"
|
||||
#include "../crypto.hpp"
|
||||
#include "../hplog.hpp"
|
||||
#include "usr.hpp"
|
||||
#include "user_session_handler.hpp"
|
||||
|
||||
namespace usr
|
||||
{
|
||||
|
||||
// The SSL context is required, and holds certificates
|
||||
ssl::context ctx{ssl::context::tlsv13};
|
||||
|
||||
/**
|
||||
* Connected (authenticated) user list. (Exposed to other sub systems)
|
||||
* Map key: User socket session id (<ip:port>)
|
||||
@@ -249,8 +252,10 @@ int remove_user(const std::string &sessionid)
|
||||
void start_listening()
|
||||
{
|
||||
auto address = net::ip::make_address(conf::cfg.listenip);
|
||||
|
||||
std::make_shared<sock::socket_server<user_outbound_message>>(
|
||||
ioc,
|
||||
ctx,
|
||||
tcp::endpoint{address, conf::cfg.pubport},
|
||||
global_usr_session_handler)
|
||||
->run();
|
||||
|
||||
Reference in New Issue
Block a user