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

CDRIVER-5951 remove deprecated TLS API #1962

Merged
merged 2 commits into from
Mar 31, 2025
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
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ Unreleased (2.0.0)
* Deprecated GridFS API has been removed:
* `mongoc_gridfs_find` is removed. Use `mongoc_gridfs_find_with_opts` instead.
* `mongoc_gridfs_find_one` is removed. Use `mongoc_gridfs_find_one_with_opts` instead.
* Deprecated TLS stream API is removed:
* `mongoc_stream_tls_do_handshake` is removed. Use `mongoc_stream_tls_handshake` instead.
* `mongoc_stream_tls_check_cert` is removed. Use `mongoc_stream_tls_handshake` instead.
* `mongoc_stream_tls_new` is removed. Use `mongoc_stream_tls_new_with_hostname` instead.

### Forwarding headers (`#include <bson.h>` and `#include <mongoc.h>`)

Expand Down
42 changes: 0 additions & 42 deletions src/libmongoc/src/mongoc/mongoc-stream-tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,42 +120,6 @@ mongoc_stream_tls_handshake_block (mongoc_stream_t *stream, const char *host, in
}
return false;
}
/**
* Deprecated. Was never supposed to be part of the public API.
* See mongoc_stream_tls_handshake.
*/
bool
mongoc_stream_tls_do_handshake (mongoc_stream_t *stream, int32_t timeout_msec)
{
mongoc_stream_tls_t *stream_tls = (mongoc_stream_tls_t *) mongoc_stream_get_tls_stream (stream);

BSON_UNUSED (timeout_msec);

BSON_ASSERT (stream_tls);

MONGOC_ERROR ("This function doesn't do anything. Please call "
"mongoc_stream_tls_handshake()");
return false;
}


/**
* Deprecated. Was never supposed to be part of the public API.
* See mongoc_stream_tls_handshake.
*/
bool
mongoc_stream_tls_check_cert (mongoc_stream_t *stream, const char *host)
{
mongoc_stream_tls_t *stream_tls = (mongoc_stream_tls_t *) mongoc_stream_get_tls_stream (stream);

BSON_UNUSED (host);

BSON_ASSERT (stream_tls);

MONGOC_ERROR ("This function doesn't do anything. Please call "
"mongoc_stream_tls_handshake()");
return false;
}


/*
Expand Down Expand Up @@ -263,10 +227,4 @@ mongoc_stream_tls_new_with_hostname_and_openssl_context (
}
#endif

mongoc_stream_t *
mongoc_stream_tls_new (mongoc_stream_t *base_stream, mongoc_ssl_opt_t *opt, int client)
{
return mongoc_stream_tls_new_with_hostname (base_stream, NULL, opt, client);
}

#endif
10 changes: 0 additions & 10 deletions src/libmongoc/src/mongoc/mongoc-stream-tls.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,10 @@ mongoc_stream_tls_handshake_block (mongoc_stream_t *stream,
int32_t timeout_msec,
bson_error_t *error);

BSON_DEPRECATED_FOR (mongoc_stream_tls_handshake)
MONGOC_EXPORT (bool) mongoc_stream_tls_do_handshake (mongoc_stream_t *stream, int32_t timeout_msec);

BSON_DEPRECATED_FOR (mongoc_stream_tls_handshake)
MONGOC_EXPORT (bool) mongoc_stream_tls_check_cert (mongoc_stream_t *stream, const char *host);

MONGOC_EXPORT (mongoc_stream_t *)
mongoc_stream_tls_new_with_hostname (mongoc_stream_t *base_stream, const char *host, mongoc_ssl_opt_t *opt, int client)
BSON_GNUC_WARN_UNUSED_RESULT;

BSON_DEPRECATED_FOR (mongoc_stream_tls_new_with_hostname)
MONGOC_EXPORT (mongoc_stream_t *)
mongoc_stream_tls_new (mongoc_stream_t *base_stream, mongoc_ssl_opt_t *opt, int client) BSON_GNUC_WARN_UNUSED_RESULT;


BSON_END_DECLS

Expand Down