Skip to content

Commit 4fa042c

Browse files
authored
CDRIVER-5951 remove deprecated TLS API (#1962)
* remove `mongoc_stream_tls_do_handshake` * remove `mongoc_stream_tls_check_cert` * remove `mongoc_stream_tls_new`
1 parent 64ecb9f commit 4fa042c

File tree

3 files changed

+4
-52
lines changed

3 files changed

+4
-52
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ Unreleased (2.0.0)
100100
* Deprecated GridFS API has been removed:
101101
* `mongoc_gridfs_find` is removed. Use `mongoc_gridfs_find_with_opts` instead.
102102
* `mongoc_gridfs_find_one` is removed. Use `mongoc_gridfs_find_one_with_opts` instead.
103+
* Deprecated TLS stream API is removed:
104+
* `mongoc_stream_tls_do_handshake` is removed. Use `mongoc_stream_tls_handshake` instead.
105+
* `mongoc_stream_tls_check_cert` is removed. Use `mongoc_stream_tls_handshake` instead.
106+
* `mongoc_stream_tls_new` is removed. Use `mongoc_stream_tls_new_with_hostname` instead.
103107

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

src/libmongoc/src/mongoc/mongoc-stream-tls.c

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -120,42 +120,6 @@ mongoc_stream_tls_handshake_block (mongoc_stream_t *stream, const char *host, in
120120
}
121121
return false;
122122
}
123-
/**
124-
* Deprecated. Was never supposed to be part of the public API.
125-
* See mongoc_stream_tls_handshake.
126-
*/
127-
bool
128-
mongoc_stream_tls_do_handshake (mongoc_stream_t *stream, int32_t timeout_msec)
129-
{
130-
mongoc_stream_tls_t *stream_tls = (mongoc_stream_tls_t *) mongoc_stream_get_tls_stream (stream);
131-
132-
BSON_UNUSED (timeout_msec);
133-
134-
BSON_ASSERT (stream_tls);
135-
136-
MONGOC_ERROR ("This function doesn't do anything. Please call "
137-
"mongoc_stream_tls_handshake()");
138-
return false;
139-
}
140-
141-
142-
/**
143-
* Deprecated. Was never supposed to be part of the public API.
144-
* See mongoc_stream_tls_handshake.
145-
*/
146-
bool
147-
mongoc_stream_tls_check_cert (mongoc_stream_t *stream, const char *host)
148-
{
149-
mongoc_stream_tls_t *stream_tls = (mongoc_stream_tls_t *) mongoc_stream_get_tls_stream (stream);
150-
151-
BSON_UNUSED (host);
152-
153-
BSON_ASSERT (stream_tls);
154-
155-
MONGOC_ERROR ("This function doesn't do anything. Please call "
156-
"mongoc_stream_tls_handshake()");
157-
return false;
158-
}
159123

160124

161125
/*
@@ -263,10 +227,4 @@ mongoc_stream_tls_new_with_hostname_and_openssl_context (
263227
}
264228
#endif
265229

266-
mongoc_stream_t *
267-
mongoc_stream_tls_new (mongoc_stream_t *base_stream, mongoc_ssl_opt_t *opt, int client)
268-
{
269-
return mongoc_stream_tls_new_with_hostname (base_stream, NULL, opt, client);
270-
}
271-
272230
#endif

src/libmongoc/src/mongoc/mongoc-stream-tls.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,10 @@ mongoc_stream_tls_handshake_block (mongoc_stream_t *stream,
4040
int32_t timeout_msec,
4141
bson_error_t *error);
4242

43-
BSON_DEPRECATED_FOR (mongoc_stream_tls_handshake)
44-
MONGOC_EXPORT (bool) mongoc_stream_tls_do_handshake (mongoc_stream_t *stream, int32_t timeout_msec);
45-
46-
BSON_DEPRECATED_FOR (mongoc_stream_tls_handshake)
47-
MONGOC_EXPORT (bool) mongoc_stream_tls_check_cert (mongoc_stream_t *stream, const char *host);
48-
4943
MONGOC_EXPORT (mongoc_stream_t *)
5044
mongoc_stream_tls_new_with_hostname (mongoc_stream_t *base_stream, const char *host, mongoc_ssl_opt_t *opt, int client)
5145
BSON_GNUC_WARN_UNUSED_RESULT;
5246

53-
BSON_DEPRECATED_FOR (mongoc_stream_tls_new_with_hostname)
54-
MONGOC_EXPORT (mongoc_stream_t *)
55-
mongoc_stream_tls_new (mongoc_stream_t *base_stream, mongoc_ssl_opt_t *opt, int client) BSON_GNUC_WARN_UNUSED_RESULT;
56-
5747

5848
BSON_END_DECLS
5949

0 commit comments

Comments
 (0)