Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update example. #1009

Merged
merged 1 commit into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/io-uring/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ xitca-http = { version = "0.4", features = ["io-uring", "router", "rustls-uring"
xitca-server = { version = "0.2", features = ["io-uring"] }
xitca-service = "0.1"

rcgen = "0.12.0"
rcgen = "0.13"
rustls = "0.23"
rustls-pki-types = "1"
10 changes: 5 additions & 5 deletions examples/io-uring/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use std::{convert::Infallible, io, sync::Arc};

use rustls::ServerConfig;
use rustls_pki_types::PrivateKeyDer;
use xitca_http::{
h1,
http::{const_header_value::TEXT_UTF8, header::CONTENT_TYPE, Request, RequestExt, Response},
Expand Down Expand Up @@ -41,12 +40,13 @@ fn tls_config() -> Arc<ServerConfig> {
let subject_alt_names = vec!["127.0.0.1".to_string(), "localhost".to_string()];

let cert = rcgen::generate_simple_self_signed(subject_alt_names).unwrap();
let key = PrivateKeyDer::Pkcs8(cert.serialize_private_key_der().into());
let cert = cert.serialize_der().unwrap().into();

let mut config = rustls::ServerConfig::builder()
let mut config = ServerConfig::builder()
.with_no_client_auth()
.with_single_cert(vec![cert], key)
.with_single_cert(
vec![cert.cert.into()],
cert.key_pair.serialize_der().try_into().unwrap(),
)
.unwrap();

config.alpn_protocols = vec![b"http/1.1".to_vec()];
Expand Down
2 changes: 1 addition & 1 deletion postgres/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ tracing = { version = "0.1.40", default-features = false }
# tls
sha2 = { version = "0.10.8", optional = true }
webpki-roots = { version = "0.26", optional = true }
xitca-tls = { version = "0.2", optional = true }
xitca-tls = { version = "0.2.3", optional = true }

# quic
quinn = { version = "0.11", git = "https://github.com/quinn-rs/quinn.git", optional = true }
Expand Down
Loading