mirror of
https://github.com/SantaSpeen/BeamMP-Server.git
synced 2026-06-18 21:00:54 +00:00
Http: Dont generate ssl key/cert with ssl off, reinterpret_cast for
windows
This commit is contained in:
+6
-1
@@ -261,6 +261,9 @@ bool Http::Server::Tx509KeypairGenerator::EnsureTLSConfigExists() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Http::Server::SetupEnvironment() {
|
void Http::Server::SetupEnvironment() {
|
||||||
|
if (!Application::Settings.HTTPServerUseSSL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
auto parent = fs::path(Application::Settings.SSLKeyPath).parent_path();
|
auto parent = fs::path(Application::Settings.SSLKeyPath).parent_path();
|
||||||
if (!fs::exists(parent))
|
if (!fs::exists(parent))
|
||||||
fs::create_directories(parent);
|
fs::create_directories(parent);
|
||||||
@@ -290,7 +293,9 @@ void Http::Server::THttpServerInstance::operator()() {
|
|||||||
beammp_info("HTTP(S) Server started on port " + std::to_string(Application::Settings.HTTPServerPort));
|
beammp_info("HTTP(S) Server started on port " + std::to_string(Application::Settings.HTTPServerPort));
|
||||||
std::unique_ptr<httplib::Server> HttpLibServerInstance;
|
std::unique_ptr<httplib::Server> HttpLibServerInstance;
|
||||||
if (Application::Settings.HTTPServerUseSSL) {
|
if (Application::Settings.HTTPServerUseSSL) {
|
||||||
HttpLibServerInstance = std::make_unique<httplib::SSLServer>(Http::Server::THttpServerInstance::CertFilePath.c_str(), Http::Server::THttpServerInstance::KeyFilePath.c_str());
|
HttpLibServerInstance = std::make_unique<httplib::SSLServer>(
|
||||||
|
reinterpret_cast<const char*>(Http::Server::THttpServerInstance::CertFilePath.c_str()),
|
||||||
|
reinterpret_cast<const char*>(Http::Server::THttpServerInstance::KeyFilePath.c_str()));
|
||||||
} else {
|
} else {
|
||||||
HttpLibServerInstance = std::make_unique<httplib::Server>();
|
HttpLibServerInstance = std::make_unique<httplib::Server>();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user