server: fix ssl ca option init

This commit is contained in:
Shuanglei Tao
2021-03-09 22:23:28 +08:00
parent 3a0aa74207
commit 0b146b750c

View File

@@ -511,9 +511,10 @@ int main(int argc, char **argv) {
if (ssl) {
info.ssl_cert_filepath = cert_path;
info.ssl_private_key_filepath = key_path;
if (strlen(ca_path) > 0)
if (strlen(ca_path) > 0) {
info.ssl_ca_filepath = ca_path;
info.options |= LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT;
}
#if LWS_LIBRARY_VERSION_MAJOR >= 2
info.options |= LWS_SERVER_OPTION_REDIRECT_HTTP_TO_HTTPS;
#endif