mirror of
https://github.com/tsl0922/ttyd.git
synced 2026-01-05 18:34:23 +01:00
server: add mbedtls support
This commit is contained in:
@@ -246,7 +246,7 @@ int callback_http(struct lws *wsi, enum lws_callback_reasons reason, void *user,
|
||||
|
||||
case LWS_CALLBACK_HTTP_FILE_COMPLETION:
|
||||
goto try_to_reuse;
|
||||
#if defined(LWS_OPENSSL_SUPPORT) || defined(LWS_WITH_TLS)
|
||||
#if (defined(LWS_OPENSSL_SUPPORT) || defined(LWS_WITH_TLS)) && !defined(LWS_WITH_MBEDTLS)
|
||||
case LWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION:
|
||||
if (!len || (SSL_get_verify_result((SSL *)in) != X509_V_OK)) {
|
||||
int err = X509_STORE_CTX_get_error((X509_STORE_CTX *)user);
|
||||
|
||||
@@ -509,8 +509,8 @@ int main(int argc, char **argv) {
|
||||
if (ssl) {
|
||||
info.ssl_cert_filepath = cert_path;
|
||||
info.ssl_private_key_filepath = key_path;
|
||||
info.ssl_ca_filepath = ca_path;
|
||||
if (strlen(info.ssl_ca_filepath) > 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;
|
||||
|
||||
Reference in New Issue
Block a user