1
0
mirror of https://github.com/fafhrd91/actix-net synced 2024-11-23 21:51:06 +01:00

prepare actix-tls 3.0.0-beta.7 release (#401)

This commit is contained in:
Rob Ede 2021-10-20 17:12:11 +01:00 committed by GitHub
parent 303666278a
commit 70ea5322ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 30 additions and 6 deletions

View File

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

View File

@ -1,6 +1,6 @@
[package]
name = "actix-tls"
version = "3.0.0-beta.6"
version = "3.0.0-beta.7"
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
description = "TLS acceptor and connector services for Actix ecosystem"
keywords = ["network", "tls", "ssl", "async", "transport"]
@ -55,7 +55,7 @@ tokio-openssl = { version = "0.6", optional = true }
# rustls
tokio-rustls = { version = "0.23", optional = true }
webpki-roots = { version = "0.21", optional = true }
webpki-roots = { version = "0.22", optional = true }
# native-tls
tokio-native-tls = { version = "0.3", optional = true }
@ -64,7 +64,7 @@ tokio-native-tls = { version = "0.3", optional = true }
actix-rt = "2.2.0"
actix-server = "2.0.0-beta.6"
bytes = "1"
env_logger = "0.8"
env_logger = "0.9"
futures-util = { version = "0.3.7", default-features = false, features = ["sink"] }
log = "0.4"
rustls-pemfile = "0.2.1"

View File

@ -21,7 +21,9 @@ mod connector;
mod error;
mod resolve;
mod service;
pub mod ssl;
pub mod tls;
#[doc(hidden)]
pub use tls as ssl;
#[cfg(feature = "uri")]
mod uri;

View File

@ -1,4 +1,4 @@
//! SSL Services
//! TLS Services
#[cfg(feature = "openssl")]
pub mod openssl;

View File

@ -14,11 +14,26 @@ use actix_rt::net::ActixStream;
use actix_service::{Service, ServiceFactory};
use futures_core::{future::LocalBoxFuture, ready};
use log::trace;
use tokio_rustls::rustls::client::ServerName;
use tokio_rustls::rustls::{client::ServerName, OwnedTrustAnchor, RootCertStore};
use tokio_rustls::{Connect, TlsConnector};
use crate::connect::{Address, Connection};
/// Returns standard root certificates from `webpki-roots` crate as a rustls certificate store.
pub fn webpki_roots_cert_store() -> RootCertStore {
let mut root_certs = RootCertStore::empty();
for cert in TLS_SERVER_ROOTS.0 {
let cert = OwnedTrustAnchor::from_subject_spki_name_constraints(
cert.subject,
cert.spki,
cert.name_constraints,
);
let certs = vec![cert].into_iter();
root_certs.add_server_trust_anchors(certs);
}
root_certs
}
/// Rustls connector factory
pub struct RustlsConnector {
connector: Arc<ClientConfig>,