Skip to content

Commit 123ec5f

Browse files
committed
added:configure ssl cert file
1 parent 257ea7e commit 123ec5f

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

XEngine_Source/StorageModule_Config/Config_Define.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,15 @@ typedef struct tag_XEngine_ServerConfig
9898
int nRVPort;
9999
TCHAR tszQQWryFile[MAX_PATH];
100100
}st_P2xp;
101+
struct
102+
{
103+
TCHAR tszCertChain[MAX_PATH];
104+
TCHAR tszCertKey[MAX_PATH];
105+
int nSslType;
106+
BOOL bDLEnable;
107+
BOOL bUPEnable;
108+
BOOL bCHEnable;
109+
}st_XCert;
101110
struct
102111
{
103112
list<string> *pStl_ListStorage;

XEngine_Source/StorageModule_Config/Config_Json/Config_Json.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,20 @@ BOOL CConfig_Json::Config_Json_File(LPCTSTR lpszConfigFile,XENGINE_SERVERCONFIG
180180
pSt_ServerConfig->st_P2xp.nSDPort = st_JsonP2xp["nSDPort"].asInt();
181181
_tcscpy(pSt_ServerConfig->st_P2xp.tszQQWryFile, st_JsonP2xp["tszQQWryFile"].asCString());
182182

183+
if (st_JsonRoot["XCert"].empty() || (6 != st_JsonRoot["XCert"].size()))
184+
{
185+
Config_IsErrorOccur = TRUE;
186+
Config_dwErrorCode = ERROR_XENGINE_BLOGIC_CONFIG_JSON_P2XP;
187+
return FALSE;
188+
}
189+
Json::Value st_JsonCert = st_JsonRoot["XCert"];
190+
pSt_ServerConfig->st_XCert.bDLEnable = st_JsonCert["bDLEnable"].asInt();
191+
pSt_ServerConfig->st_XCert.bUPEnable = st_JsonCert["bUPEnable"].asInt();
192+
pSt_ServerConfig->st_XCert.bCHEnable = st_JsonCert["bCHEnable"].asInt();
193+
pSt_ServerConfig->st_XCert.nSslType = st_JsonCert["nSslType"].asInt();
194+
_tcscpy(pSt_ServerConfig->st_XCert.tszCertChain, st_JsonP2xp["tszCertChain"].asCString());
195+
_tcscpy(pSt_ServerConfig->st_XCert.tszCertKey, st_JsonP2xp["tszCertKey"].asCString());
196+
183197
if (st_JsonRoot["XVer"].empty() || (1 != st_JsonRoot["XVer"].size()))
184198
{
185199
Config_IsErrorOccur = TRUE;

0 commit comments

Comments
 (0)