]> prime8.dev >> repos - ttyd.git/commitdiff
server: fix ssl ca option init
authorShuanglei Tao <tsl0922@gmail.com>
Tue, 9 Mar 2021 14:23:28 +0000 (22:23 +0800)
committerShuanglei Tao <tsl0922@gmail.com>
Tue, 9 Mar 2021 14:23:28 +0000 (22:23 +0800)
src/server.c

index 23e60999517fe35e26f6a348dfa180639d8a8d20..f5a3e68fd095c3bce3c38aa96ffebd7d3f176bfc 100644 (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