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

Fix error in the initial TLS server impl #250

Merged
merged 37 commits into from
Oct 27, 2023
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
ccc0696
Update README.md
minghuaw Oct 15, 2022
693963a
Merge branch 'cloudwego:main' into main
minghuaw Sep 26, 2023
f454737
added variants for tls conn
minghuaw Oct 11, 2023
bdcb0af
server performs tls handshake if tls_config exists
minghuaw Oct 11, 2023
b97607c
need alt for make tls transport
minghuaw Oct 24, 2023
800b0fb
modified ServerTlsConfig, added ClientTlsConfig
minghuaw Oct 24, 2023
ea49ee5
adding tls_config method
minghuaw Oct 24, 2023
a95a2c3
changed client tls connector to an enum
minghuaw Oct 25, 2023
f86268a
stop tracking Cargo.lock
minghuaw Oct 25, 2023
a5ec21c
wrap native tls acceptor/connector with Arc
minghuaw Oct 25, 2023
4d44607
cargo fmt
minghuaw Oct 25, 2023
25bf782
added #[cfg] to deal w/ unused imports
minghuaw Oct 25, 2023
ecc8da4
replace cfg attr w/ macro
minghuaw Oct 25, 2023
a8fb05c
pub re-export TlsAcceptor and ServerTlsConfig
minghuaw Oct 25, 2023
a1cb985
added more cfg for rustls and native-tls
minghuaw Oct 25, 2023
06d3a86
changed cfg attr to macro
minghuaw Oct 25, 2023
593f0c2
made client tls config fields public
minghuaw Oct 25, 2023
177a544
added constructors
minghuaw Oct 25, 2023
f5f0b42
added tls connector
minghuaw Oct 25, 2023
9fb6683
added example for tls
minghuaw Oct 25, 2023
0d46a61
moved dep features behind tls feature
minghuaw Oct 25, 2023
f2ac0d4
Merge branch 'cloudwego:main' into main
minghuaw Oct 26, 2023
0910b14
Merge branch 'main' into tls
minghuaw Oct 26, 2023
ac24721
removed attr impl_trait_in_assoc_type
minghuaw Oct 26, 2023
fc99d2e
moved deps to workspace
minghuaw Oct 26, 2023
e1c2a5f
feature gate mod tls and re-export
minghuaw Oct 26, 2023
0fb72d0
move dep to workspace
minghuaw Oct 26, 2023
a5bb82a
minor fix
minghuaw Oct 26, 2023
493570c
gate import behind feature gate
minghuaw Oct 26, 2023
b480388
renamed domain to server_name
minghuaw Oct 26, 2023
6ff6205
cargo fmt and hide import behind feature
minghuaw Oct 26, 2023
6b9c8d5
remove Cargo.lock from gitignore
minghuaw Oct 26, 2023
ab44810
only enable doc_cfg when building on docs.rs
minghuaw Oct 26, 2023
5cdc1a0
Merge branch 'main' into tls
minghuaw Oct 26, 2023
1c97f4b
do not return err from loop upon TLS handshake err
minghuaw Oct 27, 2023
5b23da7
Merge branch 'cloudwego:main' into main
minghuaw Oct 27, 2023
55d88b3
merge main to tls
minghuaw Oct 27, 2023
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
16 changes: 14 additions & 2 deletions volo-grpc/src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,15 +295,27 @@ impl<L> Server<L> {
match (conn.stream, self.tls_config.as_ref().map(|o| &o.acceptor)) {
#[cfg(feature = "rustls")]
(volo::net::conn::ConnStream::Tcp(tcp), Some(TlsAcceptor::Rustls(tls_acceptor))) => {
let stream = tls_acceptor.accept(tcp).await?;
let stream = match tls_acceptor.accept(tcp).await {
Ok(stream) => stream,
Err(err) => {
tracing::debug!("[VOLO] TLS handshake error: {:?}", err);
continue;
},
};
Conn {
stream: ConnStream::Rustls(tokio_rustls::TlsStream::Server(stream)),
info
}
},
#[cfg(feature = "native-tls")]
(volo::net::conn::ConnStream::Tcp(tcp), Some(TlsAcceptor::NativeTls(tls_acceptor))) => {
let stream = tls_acceptor.accept(tcp).await?;
let stream = match tls_acceptor.accept(tcp).await {
Ok(stream) => stream,
Err(err) => {
tracing::debug!("[VOLO] TLS handshake error: {:?}", err);
continue;
},
};
Conn {
stream: ConnStream::NativeTls(stream),
info,
Expand Down