Skip to content
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

http/client: add setter to disable tls server verification #1114

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions include/re_http.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ int http_client_set_keypem(struct http_cli *cli, const char *pem);
int http_client_set_session_reuse(struct http_cli *cli, bool enabled);
int http_client_set_tls_min_version(struct http_cli *cli, int version);
int http_client_set_tls_max_version(struct http_cli *cli, int version);
int http_client_disable_verify_server(struct http_cli *cli);
#endif

/* Server */
Expand Down
20 changes: 19 additions & 1 deletion src/http/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,25 @@ int http_client_set_tls_max_version(struct http_cli *cli, int version)

return tls_set_max_proto_version(cli->tls, version);
}
#endif


/**
* Disable TLS server certificate verification
*
* @param cli HTTP Client
*
* @return 0 if success, otherwise errorcode
*/
int http_client_disable_verify_server(struct http_cli *cli)
{
if (!cli)
return EINVAL;

tls_disable_verify_server(cli->tls);

return 0;
}
#endif /* USE_TLS */


/**
Expand Down
Loading