]> prime8.dev >> repos - ttyd.git/commitdiff
server: disable tls 1.0/1.1 by default for openssl
authorShuanglei Tao <tsl0922@gmail.com>
Mon, 4 Jul 2022 15:12:04 +0000 (23:12 +0800)
committerShuanglei Tao <tsl0922@gmail.com>
Mon, 4 Jul 2022 15:25:08 +0000 (23:25 +0800)
src/server.c

index 5b72c4e0311230622382aadc0888e98f04b8fa2f..c135ab94a3f73b0808c2285e16cded46b1066558 100644 (file)
@@ -532,6 +532,9 @@ int main(int argc, char **argv) {
   if (ssl) {
     info.ssl_cert_filepath = cert_path;
     info.ssl_private_key_filepath = key_path;
+    #ifndef LWS_WITH_MBEDTLS
+    info.ssl_options_set = SSL_OP_NO_TLSv1 | SSL_OP_NO_TLSv1_1;
+    #endif
     if (strlen(ca_path) > 0) {
       info.ssl_ca_filepath = ca_path;
       info.options |= LWS_SERVER_OPTION_REQUIRE_VALID_OPENSSL_CLIENT_CERT;