更新ZLToolKit(完善ssl相关)

This commit is contained in:
xiongziliang
2019-04-16 17:25:19 +08:00
parent a266123365
commit bc1a79038c
7 changed files with 20 additions and 34 deletions

View File

@@ -113,7 +113,12 @@ int main(int argc,char *argv[]){
loadIniConfig();
//加载证书,证书包含公钥和私钥
SSL_Initor::Instance().loadServerPem((exeDir() + "ssl.pem").data());
SSL_Initor::Instance().loadCertificate((exeDir() + "ssl.p12").data());
//信任某个自签名证书
SSL_Initor::Instance().trustCertificate((exeDir() + "ssl.p12").data());
//不忽略无效证书证书(例如自签名或过期证书)
SSL_Initor::Instance().ignoreInvalidCertificate(false);
//开启http服务器
TcpServer::Ptr httpSrv(new TcpServer());