aboutsummaryrefslogtreecommitdiff
path: root/zenserver/zenserver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zenserver/zenserver.cpp')
-rw-r--r--zenserver/zenserver.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/zenserver/zenserver.cpp b/zenserver/zenserver.cpp
index 6b178ee0c..03d59ba7c 100644
--- a/zenserver/zenserver.cpp
+++ b/zenserver/zenserver.cpp
@@ -204,7 +204,15 @@ public:
m_Http = zen::CreateHttpServer(ServerOptions.HttpServerClass);
int EffectiveBasePort = m_Http->Initialize(ServerOptions.BasePort);
- m_AuthMgr = MakeAuthMgr({.RootDirectory = m_DataRoot / "auth"});
+ AuthEncryptionKey EncryptionKey;
+
+ if (ServerOptions.EncryptionKey.empty() == false && ServerOptions.EncryptionIV.empty() == false)
+ {
+ EncryptionKey = AuthEncryptionKey{.Key = IoBufferBuilder::MakeCloneFromMemory(MakeMemoryView(ServerOptions.EncryptionKey)),
+ .IV = IoBufferBuilder::MakeCloneFromMemory(MakeMemoryView(ServerOptions.EncryptionIV))};
+ };
+
+ m_AuthMgr = MakeAuthMgr({.RootDirectory = m_DataRoot / "auth", .EncryptionKey = EncryptionKey});
m_AuthService = std::make_unique<zen::HttpAuthService>(*m_AuthMgr);
m_Http->RegisterService(*m_AuthService);