Skip to content

Commit 70ea532

Browse files
authored
prepare actix-tls 3.0.0-beta.7 release (#401)
1 parent 3036662 commit 70ea532

File tree

7 files changed

+30
-6
lines changed

7 files changed

+30
-6
lines changed

actix-tls/CHANGES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
## Unreleased - 2021-xx-xx
44

55

6+
## 3.0.0-beta.7 - 2021-10-20
7+
* Add `webpki_roots_cert_store()` to get rustls compatible webpki roots cert store. [#401]
8+
* Alias `connect::ssl` to `connect::tls`. [#401]
9+
10+
[#401]: https://github.com/actix/actix-net/pull/401
11+
12+
613
## 3.0.0-beta.6 - 2021-10-19
714
* Update `tokio-rustls` to `0.23` which uses `rustls` `0.20`. [#396]
815
* Removed a re-export of `Session` from `rustls` as it no longer exist. [#396]

actix-tls/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "actix-tls"
3-
version = "3.0.0-beta.6"
3+
version = "3.0.0-beta.7"
44
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
55
description = "TLS acceptor and connector services for Actix ecosystem"
66
keywords = ["network", "tls", "ssl", "async", "transport"]
@@ -55,7 +55,7 @@ tokio-openssl = { version = "0.6", optional = true }
5555

5656
# rustls
5757
tokio-rustls = { version = "0.23", optional = true }
58-
webpki-roots = { version = "0.21", optional = true }
58+
webpki-roots = { version = "0.22", optional = true }
5959

6060
# native-tls
6161
tokio-native-tls = { version = "0.3", optional = true }
@@ -64,7 +64,7 @@ tokio-native-tls = { version = "0.3", optional = true }
6464
actix-rt = "2.2.0"
6565
actix-server = "2.0.0-beta.6"
6666
bytes = "1"
67-
env_logger = "0.8"
67+
env_logger = "0.9"
6868
futures-util = { version = "0.3.7", default-features = false, features = ["sink"] }
6969
log = "0.4"
7070
rustls-pemfile = "0.2.1"

actix-tls/src/connect/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ mod connector;
2121
mod error;
2222
mod resolve;
2323
mod service;
24-
pub mod ssl;
24+
pub mod tls;
25+
#[doc(hidden)]
26+
pub use tls as ssl;
2527
#[cfg(feature = "uri")]
2628
mod uri;
2729

actix-tls/src/connect/ssl/mod.rs renamed to actix-tls/src/connect/tls/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! SSL Services
1+
//! TLS Services
22
33
#[cfg(feature = "openssl")]
44
pub mod openssl;

actix-tls/src/connect/ssl/rustls.rs renamed to actix-tls/src/connect/tls/rustls.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,26 @@ use actix_rt::net::ActixStream;
1414
use actix_service::{Service, ServiceFactory};
1515
use futures_core::{future::LocalBoxFuture, ready};
1616
use log::trace;
17-
use tokio_rustls::rustls::client::ServerName;
17+
use tokio_rustls::rustls::{client::ServerName, OwnedTrustAnchor, RootCertStore};
1818
use tokio_rustls::{Connect, TlsConnector};
1919

2020
use crate::connect::{Address, Connection};
2121

22+
/// Returns standard root certificates from `webpki-roots` crate as a rustls certificate store.
23+
pub fn webpki_roots_cert_store() -> RootCertStore {
24+
let mut root_certs = RootCertStore::empty();
25+
for cert in TLS_SERVER_ROOTS.0 {
26+
let cert = OwnedTrustAnchor::from_subject_spki_name_constraints(
27+
cert.subject,
28+
cert.spki,
29+
cert.name_constraints,
30+
);
31+
let certs = vec![cert].into_iter();
32+
root_certs.add_server_trust_anchors(certs);
33+
}
34+
root_certs
35+
}
36+
2237
/// Rustls connector factory
2338
pub struct RustlsConnector {
2439
connector: Arc<ClientConfig>,

0 commit comments

Comments
 (0)