Skip to content

Commit 5ecd693

Browse files
committed
CDRIVER-933 note change in ssl opts behavior
Beginning in version 1.2, once a pool or client has any SSL options set, all connections use SSL, even if "ssl=true" is omitted from the MongoDB URI. Before, SSL options were ignored unless "ssl=true" was included in the URI.
1 parent 6860079 commit 5ecd693

File tree

5 files changed

+29
-8
lines changed

5 files changed

+29
-8
lines changed

NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
mongo-c-driver 1.2.1
22
====================
33

4+
* mongoc_client_set_ssl_opts and mongoc_client_pool_set_ssl_opts now configure
5+
the driver to require an SSL connection to the server, even if "ssl=true" is
6+
omitted from the MongoDB URI. Before, SSL options were ignored unless
7+
"ssl=true" was included in the URI.
8+
49
mongo-c-driver 1.2.0
510
====================
611

doc/mongoc_client_pool_set_ssl_opts.page

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ mongoc_client_pool_set_ssl_opts (mongoc_client_pool_t *pool,
1919
#endif]]></code></synopsis>
2020
<p>This function is identical to <code xref="mongoc_client_set_ssl_opts">mongoc_client_set_ssl_opts()</code> except for client pools. It ensures that all clients retrieved from <code xref="mongoc_client_pool_pop">mongoc_client_pool_pop()</code> or <code xref="mongoc_client_pool_try_pop">mongoc_client_pool_try_pop()</code> are configured with the same SSL settings.</p>
2121
<p>It is a programming error to call this function after retrieving a client from the client pool.</p>
22+
<p>Beginning in version 1.2.0, once a pool has any SSL options set, all connections use SSL, even if "ssl=true" is omitted from the MongoDB URI. Before, SSL options were ignored unless "ssl=true" was included in the URI.</p>
2223
</section>
2324

2425
<section id="parameters">
@@ -29,10 +30,9 @@ mongoc_client_pool_set_ssl_opts (mongoc_client_pool_t *pool,
2930
</table>
3031
</section>
3132

32-
<section id="parameters">
33+
<section id="availability">
3334
<title>Availability</title>
34-
<p>Since 0.96.0</p>
35-
<note style="tip"><p>This feature requires that the MongoDB C driver was compiled with <code>--enable-ssl</code>.</p></note>
35+
<p>This feature requires that the MongoDB C driver was compiled with <code>--enable-ssl</code>.</p>
3636
</section>
3737

3838
</page>

doc/mongoc_client_set_ssl_opts.page

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@
1212

1313
<section id="synopsis">
1414
<title>Synopsis</title>
15-
<synopsis><code mime="text/x-csrc"><![CDATA[void
15+
<synopsis><code mime="text/x-csrc"><![CDATA[#ifdef MONGOC_ENABLE_SSL
1616
mongoc_client_set_ssl_opts (mongoc_client_t *client,
17-
const mongoc_ssl_opt_t *opts);]]></code></synopsis>
17+
const mongoc_ssl_opt_t *opts);
18+
#endif]]></code></synopsis>
1819
<p>Sets the SSL options to use when connecting to SSL enabled MongoDB servers.</p>
19-
<note><p>Although the <code>mongoc_ssl_opt_t</code> struct itself is shallow-copied by the client, the strings it points to (<code>pem_file</code>, <code>pem_pwd</code>, <code>ca_file</code>, <code>ca_dir</code>, and <code>crl_file</code>) are not copied and must remain valid for the life of the <code>mongoc_client_t</code>.</p></note>
20+
<p>Beginning in version 1.2.0, once a client has any SSL options set, all connections use SSL, even if "ssl=true" is omitted from the MongoDB URI. Before, SSL options were ignored unless "ssl=true" was included in the URI.</p>
21+
<p>Although the <code>mongoc_ssl_opt_t</code> struct itself is shallow-copied by the client, the strings it points to (<code>pem_file</code>, <code>pem_pwd</code>, <code>ca_file</code>, <code>ca_dir</code>, and <code>crl_file</code>) are not copied and must remain valid for the life of the <code>mongoc_client_t</code>.</p>
2022
</section>
2123

2224
<section id="parameters">
@@ -27,4 +29,9 @@ mongoc_client_set_ssl_opts (mongoc_client_t *client,
2729
</table>
2830
</section>
2931

32+
<section id="availability">
33+
<title>Availability</title>
34+
<p>This feature requires that the MongoDB C driver was compiled with <code>--enable-ssl</code>.</p>
35+
</section>
36+
3037
</page>

doc/mongoc_ssl_opt_t.page

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,20 @@
2727

2828
<section id="desc">
2929
<title>Description</title>
30-
<p>This structure is used to set the SSL options for a <code xref="mongoc_client_t">mongoc_client_t</code>.</p>
30+
<p>This structure is used to set the SSL options for a <code xref="mongoc_client_t">mongoc_client_t</code> or <code xref="mongoc_client_pool_t">mongoc_client_pool_t</code>.</p>
31+
<p>Beginning in version 1.2.0, once a pool or client has any SSL options set, all connections use SSL, even if "ssl=true" is omitted from the MongoDB URI. Before, SSL options were ignored unless "ssl=true" was included in the URI.</p>
3132
</section>
3233

3334
<links type="topic" groups="function" style="2column">
3435
<title>Functions</title>
3536
</links>
3637

38+
<section id="seealso">
39+
<title>See Also</title>
40+
<list>
41+
<item><p><link type="seealso" xref="mongoc_client_set_ssl_opts"><code>mongoc_client_set_ssl_opts</code></link></p></item>
42+
<item><p><link type="seealso" xref="mongoc_client_pool_set_ssl_opts"><code>mongoc_client_pool_set_ssl_opts</code></link></p></item>
43+
</list>
44+
</section>
45+
3746
</page>

doc/mongoc_uri_t.page

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<section id="conn-options">
5656
<title>Connection Options</title>
5757
<table>
58-
<tr><td><p>ssl</p></td><td><p>{true|false}, indicating if SSL must be used.</p></td></tr>
58+
<tr><td><p>ssl</p></td><td><p>{true|false}, indicating if SSL must be used. (See also <code xref="mongoc_client_set_ssl_opts">mongoc_client_set_ssl_opts</code> and <code xref="mongoc_client_pool_set_ssl_opts">mongoc_client_pool_set_ssl_opts</code>.)</p></td></tr>
5959
<tr><td><p>connectTimeoutMS</p></td><td><p>A timeout in milliseconds to attempt a connection before timing out. This setting applies to server discovery and monitoring connections as well as to connections for application operations. The default is 10 seconds.</p></td></tr>
6060
<tr><td><p>socketTimeoutMS</p></td><td><p>The time in milliseconds to attempt to send or receive on a socket before the attempt times out. The default is 5 minutes.</p></td></tr>
6161
</table>

0 commit comments

Comments
 (0)