mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2025-07-02 15:55:30 +00:00
Http: Dont generate ssl key/cert with ssl off, reinterpret_cast for
windows
This commit is contained in:
parent
924e18c163
commit
ca5b3956a1
@ -261,6 +261,9 @@ bool Http::Server::Tx509KeypairGenerator::EnsureTLSConfigExists() {
|
||||
}
|
||||
|
||||
void Http::Server::SetupEnvironment() {
|
||||
if (!Application::Settings.HTTPServerUseSSL) {
|
||||
return;
|
||||
}
|
||||
auto parent = fs::path(Application::Settings.SSLKeyPath).parent_path();
|
||||
if (!fs::exists(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));
|
||||
std::unique_ptr<httplib::Server> HttpLibServerInstance;
|
||||
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 {
|
||||
HttpLibServerInstance = std::make_unique<httplib::Server>();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user