8000 http: add compile-time check for USE_TLS by alfredh · Pull Request #841 · baresip/re · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

http: add compile-time check for USE_TLS #841

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/http/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ static void verify_cert_done(void *arg)
}


#ifdef USE_TLS
static int http_verify_handler(int ok, void *arg)
{
struct http_verify_msg_d *d = arg;
Expand All @@ -146,12 +147,12 @@ static int http_verify_handler(int ok, void *arg)

return ok;
}
#endif


static enum re_https_verify_msg verify_msg(struct http_conn *conn,
struct http_msg *msg)
{
int err;
enum re_https_verify_msg res;
struct http_verify_msg_d *d;

Expand Down Expand Up @@ -180,7 +181,8 @@ static enum re_https_verify_msg verify_msg(struct http_conn *conn,
tmr_start(&conn->verify_cert_tmr, TIMEOUT_IDLE,
verify_cert_done, d);

err = tls_set_verify_client_handler(http_conn_tls(conn),
#ifdef USE_TLS
int err = tls_set_verify_client_handler(http_conn_tls(conn),
-1, http_verify_handler, d);
if (err) {
res = HTTPS_MSG_IGNORE;
Expand All @@ -193,6 +195,7 @@ static enum re_https_verify_msg verify_msg(struct http_conn *conn,
res = HTTPS_MSG_IGNORE;
goto out;
}
#endif
}

out:
Expand Down
0