openssl 쳐내!

This commit is contained in:
2025-06-15 23:21:54 +09:00
parent 9949ec80fb
commit 54fab0ad23
7 changed files with 9 additions and 161 deletions

View File

@@ -11,31 +11,7 @@ Session::Session(gsl::not_null<Network::IOCP*> iocp, utils::ThreadPool* tp,
: iocp_(iocp), tp_(tp), proto_(proto) {
switch (proto) {
case SessionProtocol::UDP:
case SessionProtocol::QUIC: {
Network::UDPSocket* sock = new Network::UDPSocket();
sock_ = sock;
sock->init(addr.family);
switch (type) {
case SessionType::CONNECT:
ssl_ctx_ = ::SSL_CTX_new(::OSSL_QUIC_client_method());
if (ssl_ctx_ == nullptr) {
spdlog::critical("SSL_CTX_new()");
std::exit(EXIT_FAILURE);
}
::SSL_CTX_set_verify(ssl_ctx_, SSL_VERIFY_PEER, NULL);
if (!::SSL_CTX_set_default_verify_paths(ssl_ctx_)) {
spdlog::critical("SSL_CTX_set_default_verify_paths()");
std::exit(EXIT_FAILURE);
}
break;
case SessionType::LISTEN:
sock->bind(addr);
break;
default:
std::exit(EXIT_FAILURE);
}
} break;
case SessionProtocol::QUIC:
case SessionProtocol::TCP:
case SessionProtocol::TLS: {
Network::TCPSocket* sock = new Network::TCPSocket();
@@ -56,12 +32,6 @@ Session::Session(gsl::not_null<Network::IOCP*> iocp, utils::ThreadPool* tp,
default:
std::exit(EXIT_FAILURE);
}
ssl_ = ::SSL_new(ssl_ctx_);
if (ssl_ == nullptr) {
spdlog::critical("SSL_new()");
std::exit(EXIT_FAILURE);
}
}
Session::~Session() {