Skip to content

Commit 53fa15a

Browse files
release v3.2.1 (#1299)
* Fix compilation when `dns-resolver` is disabled (#1292) * RUST-2144 Remove use of deprecated `openssl_probe` method (#1294) * RUST-2144 Use recommended openssl probing API (#1297) * RUST-2143 Test compiling with no default features enabled (#1296) * release v3.2.1 --------- Co-authored-by: Abraham Egnor <abraham.egnor@mongodb.com>
1 parent 974465a commit 53fa15a

File tree

7 files changed

+20
-15
lines changed

7 files changed

+20
-15
lines changed

.evergreen/compile-only.sh

+3
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ cargo $TOOLCHAIN build
1717

1818
# Test with all features.
1919
cargo $TOOLCHAIN build --all-features
20+
21+
# Test with no default features.
22+
cargo $TOOLCHAIN build --no-default-features --features compat-3-0-0,rustls-tls

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ homepage = "https://www.mongodb.com/docs/drivers/rust/"
1616
license = "Apache-2.0"
1717
readme = "README.md"
1818
name = "mongodb"
19-
version = "3.2.0"
19+
version = "3.2.1"
2020

2121
exclude = [
2222
"etc/**",
@@ -92,7 +92,7 @@ once_cell = "1.19.0"
9292
log = { version = "0.4.17", optional = true }
9393
md-5 = "0.10.1"
9494
mongocrypt = { git = "https://github.com/mongodb/libmongocrypt-rust.git", branch = "main", optional = true, version = "0.2.1" }
95-
mongodb-internal-macros = { path = "macros", version = "3.2.0" }
95+
mongodb-internal-macros = { path = "macros", version = "3.2.1" }
9696
num_cpus = { version = "1.13.1", optional = true }
9797
openssl = { version = "0.10.38", optional = true }
9898
openssl-probe = { version = "0.1.5", optional = true }

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The driver tests against Linux, MacOS, and Windows in CI.
1818
The driver is available on [crates.io](https://crates.io/crates/mongodb). To use the driver in your application, simply add it to your project's `Cargo.toml`.
1919
```toml
2020
[dependencies]
21-
mongodb = "3.2.0"
21+
mongodb = "3.2.1"
2222
```
2323

2424
Version 1 of this crate has reached end of life and will no longer be receiving any updates or bug fixes, so all users are recommended to always depend on the latest 2.x release. See the [2.0.0 release notes](https://github.com/mongodb/mongo-rust-driver/releases/tag/v2.0.0) for migration information if upgrading from a 1.x version.
@@ -27,7 +27,7 @@ Version 1 of this crate has reached end of life and will no longer be receiving
2727
The driver also provides a blocking sync API. To enable this, add the `"sync"` feature to your `Cargo.toml`:
2828
```toml
2929
[dependencies.mongodb]
30-
version = "3.2.0"
30+
version = "3.2.1"
3131
features = ["sync"]
3232
```
3333
**Note:** The sync-specific types can be imported from `mongodb::sync` (e.g. `mongodb::sync::Client`).

macros/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mongodb-internal-macros"
3-
version = "3.2.0"
3+
version = "3.2.1"
44
description = "Internal macros for the mongodb crate"
55
edition = "2021"
66
license = "Apache-2.0"

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
)]
1313
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
1414
#![cfg_attr(test, type_length_limit = "80000000")]
15-
#![doc(html_root_url = "https://docs.rs/mongodb/3.2.0")]
15+
#![doc(html_root_url = "https://docs.rs/mongodb/3.2.1")]
1616

1717
#[macro_use]
1818
pub mod options;

src/runtime/tls_openssl.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::{pin::Pin, sync::Once};
1+
use std::pin::Pin;
22

33
use openssl::{
44
error::ErrorStack,
@@ -45,8 +45,6 @@ pub(super) async fn tls_connect(
4545
tcp_stream: TcpStream,
4646
cfg: &TlsConfig,
4747
) -> Result<TlsStream> {
48-
init_trust();
49-
5048
let mut stream = make_ssl_stream(host, tcp_stream, cfg).map_err(|err| {
5149
Error::from(ErrorKind::InvalidTlsConfig {
5250
message: err.to_string(),
@@ -71,6 +69,11 @@ fn make_openssl_connector(cfg: TlsOptions) -> Result<SslConnector> {
7169

7270
let mut builder = SslConnector::builder(SslMethod::tls_client()).map_err(openssl_err)?;
7371

72+
let probe = openssl_probe::probe();
73+
builder
74+
.load_verify_locations(probe.cert_file.as_deref(), probe.cert_dir.as_deref())
75+
.map_err(openssl_err)?;
76+
7477
let TlsOptions {
7578
allow_invalid_certificates,
7679
ca_file_path,
@@ -111,11 +114,6 @@ fn make_openssl_connector(cfg: TlsOptions) -> Result<SslConnector> {
111114
Ok(builder.build())
112115
}
113116

114-
fn init_trust() {
115-
static ONCE: Once = Once::new();
116-
ONCE.call_once(openssl_probe::init_ssl_cert_env_vars);
117-
}
118-
119117
fn make_ssl_stream(
120118
host: &str,
121119
tcp_stream: TcpStream,

src/srv.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub(crate) struct LookupHosts {
2020
}
2121

2222
impl LookupHosts {
23+
#[cfg(feature = "dns-resolver")]
2324
pub(crate) fn validate(mut self, original_hostname: &str, dm: DomainMismatch) -> Result<Self> {
2425
let original_hostname_parts: Vec<_> = original_hostname.split('.').collect();
2526
let original_domain_name = if original_hostname_parts.len() >= 3 {
@@ -261,7 +262,10 @@ pub(crate) struct SrvResolver {}
261262

262263
#[cfg(not(feature = "dns-resolver"))]
263264
impl SrvResolver {
264-
pub(crate) async fn new(_config: Option<ResolverConfig>) -> Result<Self> {
265+
pub(crate) async fn new(
266+
_config: Option<ResolverConfig>,
267+
_srv_service_name: Option<String>,
268+
) -> Result<Self> {
265269
Ok(Self {})
266270
}
267271

0 commit comments

Comments
 (0)