You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-08-09 04:22:45 +03:00
Use rustls-platform-verifier for cert validation
This simplifies by removing the mutually exclusive `native-roots` and `webpki-roots` features with something that is suitable for all platforms.
This commit is contained in:
@@ -14,8 +14,8 @@
|
||||
|
||||
use axum::body::Full;
|
||||
use mas_http::{
|
||||
make_traced_connector, BodyToBytesResponseLayer, Client, ClientInitError, ClientLayer,
|
||||
ClientService, HttpService, TracedClient, TracedConnector,
|
||||
make_traced_connector, BodyToBytesResponseLayer, Client, ClientLayer, ClientService,
|
||||
HttpService, TracedClient, TracedConnector,
|
||||
};
|
||||
use tower::{
|
||||
util::{MapErrLayer, MapRequestLayer},
|
||||
@@ -28,18 +28,20 @@ pub struct HttpClientFactory {
|
||||
client_layer: ClientLayer,
|
||||
}
|
||||
|
||||
impl Default for HttpClientFactory {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl HttpClientFactory {
|
||||
/// Constructs a new HTTP client factory
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// Returns an error if the client factory failed to initialise, which can
|
||||
/// happen when it fails to load the system's CA certificates.
|
||||
pub async fn new() -> Result<Self, ClientInitError> {
|
||||
Ok(Self {
|
||||
traced_connector: make_traced_connector().await?,
|
||||
#[must_use]
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
traced_connector: make_traced_connector(),
|
||||
client_layer: ClientLayer::new(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// Constructs a new HTTP client
|
||||
|
Reference in New Issue
Block a user