Skip to content

Commit

Permalink
Updated axum-server to v0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda committed Jul 30, 2024
1 parent 83aff34 commit 6a9bb7d
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Changed

- Updated `axum-server` to v0.7.
- Updated `tokio-rustls` to v0.26.

## [0.6.0] - 2023-12-22

### Added
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ rust-version = "1.66"
version = "0.6.0"

[dependencies]
axum-server = { version = "0.6", features = ["tls-rustls"] }
axum-server = { version = "0.7", features = ["tls-rustls"] }
bytes = { version = "1", default-features = false }
http = "1"
http-body-util = "0.1"
pin-project = "1"
tokio = "1"
tokio-rustls = { version = "0.24", default-features = false }
tokio-rustls = { version = "0.26", default-features = false }
tokio-util = "0.7.1"
tower-layer = "0.3"
tower-service = "0.3"
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ let app = Router::new()
.layer(UpgradeHttpLayer);
```

Don't forget to setup a default [`CryptoProvider`].

## Conditional Configurations

### `docsrs`
Expand Down Expand Up @@ -92,9 +94,10 @@ additional terms or conditions.
[LICENSE-MIT]: https://github.com/daxpedda/axum-server-dual-protocol/blob/v0.6.0/LICENSE-MIT
[LICENSE-APACHE]: https://github.com/daxpedda/axum-server-dual-protocol/blob/v0.6.0/LICENSE-APACHE
[`axum`]: https://docs.rs/axum/0.7
[`axum-server`]: https://docs.rs/axum-server/0.6.0
[`axum-server`]: https://docs.rs/axum-server/0.7.0
[`bind_dual_protocol()`]:
https://docs.rs/axum-server-dual-protocol/0.6.0/axum_server_dual_protocol/fn.bind_dual_protocol.html
[`CryptoProvider`]: https://docs.rs/rustls/0.23/rustls/crypto/struct.CryptoProvider.html
[`hyper`]: https://docs.rs/hyper/1
[`Layer`]: https://docs.rs/tower-layer/0.3/tower_layer/trait.Layer.html
[`Router`]: https://docs.rs/axum/0.7/axum/struct.Router.html
Expand Down
3 changes: 3 additions & 0 deletions examples/hello-world.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,12 @@ use anyhow::Result;
use axum::{routing, Router};
use axum_server::tls_rustls::RustlsConfig;
use axum_server_dual_protocol::ServerExt;
use tokio_rustls::rustls::crypto::aws_lc_rs;

#[tokio::main]
async fn main() -> Result<()> {
let _ = aws_lc_rs::default_provider().install_default();

let app = Router::new().route("/", routing::get(|| async { "Hello, world!" }));

let address = SocketAddr::from(([127, 0, 0, 1], 3000));
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@
//! # .serve(app.into_make_service());
//! ```
//!
//! Don't forget to setup a default [`CryptoProvider`].
//!
//! # Conditional Configurations
//!
//! ## `docsrs`
Expand Down Expand Up @@ -121,6 +123,7 @@
//! [LICENSE-MIT]: https://github.com/daxpedda/axum-server-dual-protocol/blob/v0.6.0/LICENSE-MIT
//! [LICENSE-APACHE]: https://github.com/daxpedda/axum-server-dual-protocol/blob/v0.6.0/LICENSE-APACHE
//! [`axum`]: https://docs.rs/axum/0.7
//! [`CryptoProvider`]: tokio_rustls::rustls::crypto::CryptoProvider
//! [`hyper`]: https://docs.rs/hyper/1
//! [`Router`]: https://docs.rs/axum/0.7/axum/struct.Router.html
//! [`tower`]: https://docs.rs/tower/0.4
Expand Down
3 changes: 3 additions & 0 deletions tests/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use futures_util::{future, TryFutureExt};
use http::{Request, Response};
use hyper::body::{Body, Incoming};
use reqwest::Certificate;
use tokio_rustls::rustls::crypto::aws_lc_rs;
use tower_service::Service;

pub(crate) fn server(address: SocketAddr, config: RustlsConfig) -> Server<DualProtocolAcceptor> {
Expand Down Expand Up @@ -44,6 +45,8 @@ where
ClientFn: 'static + FnOnce(Certificate, SocketAddr) -> ClientFuture + Send,
ClientFuture: Future<Output = Result<()>> + Send,
{
let _ = aws_lc_rs::default_provider().install_default();

let handle = Handle::new();

let key_pair = rcgen::generate_simple_self_signed([String::from("localhost")])?;
Expand Down

0 comments on commit 6a9bb7d

Please sign in to comment.