Skip to content

Commit bab6682

Browse files
committed
Enable logging and use SSL certificate chain
1 parent 467038b commit bab6682

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎httpd/src/main.cpp‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,7 +1865,9 @@ int main(int argc, char** argv)
18651865

18661866
// 初始化日志系统,可指定日志输出目录.
18671867
if (vm.count("log-dir"))
1868+
{
18681869
xlogger::init_logging(httpd_log_dir);
1870+
}
18691871

18701872
// SSL 证书目录处理.
18711873
if (vm.count("ssl-cert-dir"))
@@ -1896,9 +1898,8 @@ int main(int argc, char** argv)
18961898
{
18971899
boost::system::error_code ec;
18981900

1899-
global_ssl_ctx->use_certificate_file(
1900-
info.cert_file.string(),
1901-
ssl::context::pem, ec);
1901+
global_ssl_ctx->use_certificate_chain_file(
1902+
info.cert_file.string(), ec);
19021903
if (ec)
19031904
{
19041905
XLOG_ERR << "Failed to load cert: "
@@ -1924,8 +1925,7 @@ int main(int argc, char** argv)
19241925
break; // 目前只使用找到的第一个有效证书.
19251926
}
19261927

1927-
// Set default password callback and verify options.
1928-
global_ssl_ctx->set_verify_mode(ssl::verify_none);
1928+
// verify options.
19291929
global_ssl_ctx->set_options(
19301930
ssl::context::default_workarounds |
19311931
ssl::context::no_sslv2 |

0 commit comments

Comments
 (0)