| 1 |
use futures_utilrust-analyzer cargo futures-util 0.3.34 crate/::futurerust-analyzer cargo futures-util 0.3.34 future/; |
| 2 |
use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::{selfrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/, BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#, Cursorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/cursor/Cursor#, Readrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Read#, Writerust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Write#}; |
| 3 |
use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::syncrust-analyzer cargo std https://github.com/rust-lang/rust/library/std sync/::Arcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/Arc#; |
| 4 |
use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::taskrust-analyzer cargo std https://github.com/rust-lang/rust/library/std task/::{Contextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/wake/Context#, Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#}; |
| 5 |
|
| 6 |
use rustlsrust-analyzer cargo rustls 0.23.43 crate/::{ |
| 7 |
clientrust-analyzer cargo rustls 0.23.43 client/::{ |
| 8 |
dangerrust-analyzer cargo rustls 0.23.43 client/danger/::{ServerCertVerifiedrust-analyzer cargo rustls 0.23.43 verify/ServerCertVerified#, ServerCertVerifierrust-analyzer cargo rustls 0.23.43 verify/ServerCertVerifier#}, |
| 9 |
WebPkiServerVerifierrust-analyzer cargo rustls 0.23.43 webpki/server_verifier/WebPkiServerVerifier#, |
| 10 |
}, |
| 11 |
cryptorust-analyzer cargo rustls 0.23.43 crypto/::{verify_tls12_signaturerust-analyzer cargo rustls 0.23.43 webpki/verify/verify_tls12_signature()., verify_tls13_signaturerust-analyzer cargo rustls 0.23.43 webpki/verify/verify_tls13_signature()., CryptoProviderrust-analyzer cargo rustls 0.23.43 crypto/CryptoProvider#}, |
| 12 |
pki_typesrust-analyzer cargo rustls 0.23.43 pki_types/::{CertificateDerrust-analyzer cargo rustls-pki-types 1.15.1 CertificateDer#, PrivateKeyDerrust-analyzer cargo rustls-pki-types 1.15.1 PrivateKeyDer#, ServerNamerust-analyzer cargo rustls-pki-types 1.15.1 server_name/ServerName#, UnixTimerust-analyzer cargo rustls-pki-types 1.15.1 UnixTime#}, |
| 13 |
CertificateErrorrust-analyzer cargo rustls 0.23.43 error/CertificateError#, ClientConfigrust-analyzer cargo rustls 0.23.43 client/client_conn/ClientConfig#, ClientConnectionrust-analyzer cargo rustls 0.23.43 client/client_conn/connection/ClientConnection#, Errorrust-analyzer cargo rustls 0.23.43 error/Error# as TlsErrorrust-analyzer cargo rustls 0.23.43 error/Error#, RootCertStorerust-analyzer cargo rustls 0.23.43 webpki/anchors/RootCertStore#, |
| 14 |
}; |
| 15 |
|
| 16 |
use craterust-analyzer cargo sqlx-core 0.8.3 crate/::errorrust-analyzer cargo sqlx-core 0.8.3 error/::Errorrust-analyzer cargo sqlx-core 0.8.3 error/Error#; |
| 17 |
use craterust-analyzer cargo sqlx-core 0.8.3 crate/::iorust-analyzer cargo sqlx-core 0.8.3 io/::ReadBufrust-analyzer cargo sqlx-core 0.8.3 io/read_buf/ReadBuf#; |
| 18 |
use craterust-analyzer cargo sqlx-core 0.8.3 crate/::netrust-analyzer cargo sqlx-core 0.8.3 net/::tlsrust-analyzer cargo sqlx-core 0.8.3 net/tls/::utilrust-analyzer cargo sqlx-core 0.8.3 net/tls/util/::StdSocketrust-analyzer cargo sqlx-core 0.8.3 net/tls/util/StdSocket#; |
| 19 |
use craterust-analyzer cargo sqlx-core 0.8.3 crate/::netrust-analyzer cargo sqlx-core 0.8.3 net/::tlsrust-analyzer cargo sqlx-core 0.8.3 net/tls/::TlsConfigrust-analyzer cargo sqlx-core 0.8.3 net/tls/TlsConfig#; |
| 20 |
use craterust-analyzer cargo sqlx-core 0.8.3 crate/::netrust-analyzer cargo sqlx-core 0.8.3 net/::Socketrust-analyzer cargo sqlx-core 0.8.3 net/socket/Socket#; |
| 21 |
|
| 22 |
pub struct RustlsSocketrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/RustlsSocket#<S: Socketrust-analyzer cargo sqlx-core 0.8.3 net/socket/Socket#> { |
| 23 |
innerrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/RustlsSocket#inner.: StdSocketrust-analyzer cargo sqlx-core 0.8.3 net/tls/util/StdSocket#<S>, |
| 24 |
staterust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/RustlsSocket#state.: ClientConnectionrust-analyzer cargo rustls 0.23.43 client/client_conn/connection/ClientConnection#, |
| 25 |
close_notify_sentrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/RustlsSocket#close_notify_sent.: bool, |
| 26 |
} |
| 27 |
|
| 28 |
impl<S: Socketrust-analyzer cargo sqlx-core 0.8.3 net/socket/Socket#> RustlsSocketrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/RustlsSocket#<S> { |
| 29 |
fn poll_complete_iorust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/impl#[`RustlsSocket<S>`]poll_complete_io().(&mut self, cx: &mut Contextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/wake/Context#<'_>) -> Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#<iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()>> { |
| 30 |
loop { |
| 31 |
match self.staterust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/RustlsSocket#state..complete_iorust-analyzer cargo rustls 0.23.43 conn/impl#[`ConnectionCommon<Data>`]complete_io().(&mut self.innerrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/RustlsSocket#inner.) { |
| 32 |
Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(e) if e.kindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[Error]kind().() rust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[ErrorKind][`PartialEq<Self>`]eq().==rust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[ErrorKind][`PartialEq<Self>`]eq(). rust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[ErrorKind][`PartialEq<Self>`]eq().iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::WouldBlockrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#WouldBlock# => { |
| 33 |
futures_utilrust-analyzer cargo futures-util 0.3.34 crate/::readyrust-analyzer cargo futures-core 0.3.34 task/poll/ready!!(self.innerrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/RustlsSocket#inner..poll_readyrust-analyzer cargo sqlx-core 0.8.3 net/tls/util/impl#[`StdSocket<S>`]poll_ready().(cx))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 34 |
} |
| 35 |
ready => return Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#::Readyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#Ready#(ready.maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map().(|_| ())), |
| 36 |
} |
| 37 |
} |
| 38 |
} |
| 39 |
|
| 40 |
async fn complete_iorust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/impl#[`RustlsSocket<S>`]complete_io().(&mut self) -> iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()> { |
| 41 |
futurerust-analyzer cargo futures-util 0.3.34 future/::poll_fnrust-analyzer cargo futures-util 0.3.34 future/poll_fn/poll_fn().(|cx| self.poll_complete_iorust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/impl#[`RustlsSocket<S>`]poll_complete_io().(cx)).rust-analyzer cargo futures-util 0.3.34 future/poll_fn/impl#[`PollFn<F>`][Future]poll().awaitrust-analyzer cargo futures-util 0.3.34 future/poll_fn/impl#[`PollFn<F>`][Future]poll(). |
| 42 |
} |
| 43 |
} |
| 44 |
|
| 45 |
impl<S: Socketrust-analyzer cargo sqlx-core 0.8.3 net/socket/Socket#> Socketrust-analyzer cargo sqlx-core 0.8.3 net/socket/Socket# for RustlsSocketrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/RustlsSocket#<S> { |
| 46 |
fn try_readrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/impl#[`RustlsSocket<S>`][Socket]try_read().(&mut self, buf: &mut dyn ReadBufrust-analyzer cargo sqlx-core 0.8.3 io/read_buf/ReadBuf#) -> iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<usize> { |
| 47 |
self.staterust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/RustlsSocket#state..readerrust-analyzer cargo rustls 0.23.43 conn/impl#[`ConnectionCommon<Data>`]reader().().readrust-analyzer cargo rustls 0.23.43 conn/connection/impl#[`Reader<'_>`][Read]read().(buf.init_mutrust-analyzer cargo sqlx-core 0.8.3 io/read_buf/ReadBuf#init_mut().()) |
| 48 |
} |
| 49 |
|
| 50 |
fn try_writerust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/impl#[`RustlsSocket<S>`][Socket]try_write().(&mut self, buf: &[u8]) -> iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<usize> { |
| 51 |
match self.staterust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/RustlsSocket#state..writerrust-analyzer cargo rustls 0.23.43 conn/impl#[`ConnectionCommon<Data>`]writer().().writerust-analyzer cargo rustls 0.23.43 conn/connection/impl#[`Writer<'_>`][Write]write().(buf) { |
| 52 |
// Returns a zero-length write when the buffer is full. |
| 53 |
Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(0) => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::WouldBlockrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#WouldBlock#.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()), |
| 54 |
other => other, |
| 55 |
} |
| 56 |
} |
| 57 |
|
| 58 |
fn poll_read_readyrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/impl#[`RustlsSocket<S>`][Socket]poll_read_ready().(&mut self, cx: &mut Contextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/wake/Context#<'_>) -> Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#<iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()>> { |
| 59 |
self.poll_complete_iorust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/impl#[`RustlsSocket<S>`]poll_complete_io().(cx) |
| 60 |
} |
| 61 |
|
| 62 |
fn poll_write_readyrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/impl#[`RustlsSocket<S>`][Socket]poll_write_ready().(&mut self, cx: &mut Contextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/wake/Context#<'_>) -> Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#<iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()>> { |
| 63 |
self.poll_complete_iorust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/impl#[`RustlsSocket<S>`]poll_complete_io().(cx) |
| 64 |
} |
| 65 |
|
| 66 |
fn poll_flushrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/impl#[`RustlsSocket<S>`][Socket]poll_flush().(&mut self, cx: &mut Contextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/wake/Context#<'_>) -> Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#<iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()>> { |
| 67 |
self.poll_complete_iorust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/impl#[`RustlsSocket<S>`]poll_complete_io().(cx) |
| 68 |
} |
| 69 |
|
| 70 |
fn poll_shutdownrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/impl#[`RustlsSocket<S>`][Socket]poll_shutdown().(&mut self, cx: &mut Contextrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/wake/Context#<'_>) -> Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#<iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Resultrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Result#<()>> { |
| 71 |
if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().self.close_notify_sentrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/RustlsSocket#close_notify_sent. { |
| 72 |
self.staterust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/RustlsSocket#state..send_close_notifyrust-analyzer cargo rustls 0.23.43 common_state/impl#[CommonState]send_close_notify().(); |
| 73 |
self.close_notify_sentrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/RustlsSocket#close_notify_sent. = true; |
| 74 |
} |
| 75 |
|
| 76 |
futures_utilrust-analyzer cargo futures-util 0.3.34 crate/::readyrust-analyzer cargo futures-core 0.3.34 task/poll/ready!!(self.poll_complete_iorust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/impl#[`RustlsSocket<S>`]poll_complete_io().(cx))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 77 |
|
| 78 |
// Server can close socket as soon as it receives the connection shutdown request. |
| 79 |
// We shouldn't expect it to stick around for the TLS session to close cleanly. |
| 80 |
// https://security.stackexchange.com/a/82034 |
| 81 |
let _ = futures_utilrust-analyzer cargo futures-util 0.3.34 crate/::readyrust-analyzer cargo futures-core 0.3.34 task/poll/ready!!(self.innerrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/RustlsSocket#inner..socketrust-analyzer cargo sqlx-core 0.8.3 net/tls/util/StdSocket#socket..poll_shutdownrust-analyzer cargo sqlx-core 0.8.3 net/socket/Socket#poll_shutdown().(cx)); |
| 82 |
|
| 83 |
Pollrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#::Readyrust-analyzer cargo core https://github.com/rust-lang/rust/library/core task/poll/Poll#Ready#(Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(())) |
| 84 |
} |
| 85 |
} |
| 86 |
|
| 87 |
pub async fn handshakerust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/handshake().<S>(socket: S, tls_config: TlsConfigrust-analyzer cargo sqlx-core 0.8.3 net/tls/TlsConfig#<'_>) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<RustlsSocketrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/RustlsSocket#<S>, Errorrust-analyzer cargo sqlx-core 0.8.3 error/Error#> |
| 88 |
where |
| 89 |
S: Socketrust-analyzer cargo sqlx-core 0.8.3 net/socket/Socket#, |
| 90 |
{ |
| 91 |
#[cfg(all( |
| 92 |
feature = "_tls-rustls-aws-lc-rs", |
| 93 |
not(feature = "_tls-rustls-ring-webpki"), |
| 94 |
not(feature = "_tls-rustls-ring-native-roots") |
| 95 |
))] |
| 96 |
let provider = Arcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/Arc#::new(rustlsrust-analyzer cargo rustls 0.23.43 crate/::cryptorust-analyzer cargo rustls 0.23.43 crypto/::aws_lc_rs::default_provider()); |
| 97 |
#[cfg(any( |
| 98 |
feature = "_tls-rustls-ring-webpki", |
| 99 |
feature = "_tls-rustls-ring-native-roots" |
| 100 |
))] |
| 101 |
let provider = Arcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/Arc#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/impl#[`Arc<T>`]new().(rustlsrust-analyzer cargo rustls 0.23.43 crate/::cryptorust-analyzer cargo rustls 0.23.43 crypto/::ringrust-analyzer cargo rustls 0.23.43 crypto/ring/::default_providerrust-analyzer cargo rustls 0.23.43 crypto/ring/default_provider().()); |
| 102 |
|
| 103 |
// Unwrapping is safe here because we use a default provider. |
| 104 |
let config = ClientConfigrust-analyzer cargo rustls 0.23.43 client/client_conn/ClientConfig#::builder_with_providerrust-analyzer cargo rustls 0.23.43 client/client_conn/impl#[ClientConfig]builder_with_provider().(provider.clonerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/impl#[`Arc<T, A>`][Clone]clone().()) |
| 105 |
.with_safe_default_protocol_versionsrust-analyzer cargo rustls 0.23.43 builder/impl#[`ConfigBuilder<S, WantsVersions>`]with_safe_default_protocol_versions().() |
| 106 |
.unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 107 |
|
| 108 |
// authentication using user's key and its associated certificate |
| 109 |
let user_auth = match (tls_config.client_cert_pathrust-analyzer cargo sqlx-core 0.8.3 net/tls/TlsConfig#client_cert_path., tls_config.client_key_pathrust-analyzer cargo sqlx-core 0.8.3 net/tls/TlsConfig#client_key_path.) { |
| 110 |
(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(cert_path), Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(key_path)) => { |
| 111 |
let cert_chain = certs_from_pemrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/certs_from_pem().(cert_path.datarust-analyzer cargo sqlx-core 0.8.3 net/tls/impl#[CertificateInput]data().().rust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll().awaitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 112 |
let key_der = private_key_from_pemrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/private_key_from_pem().(key_path.datarust-analyzer cargo sqlx-core 0.8.3 net/tls/impl#[CertificateInput]data().().rust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll().awaitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 113 |
Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#((cert_chain, key_der)) |
| 114 |
} |
| 115 |
(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#) => Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#, |
| 116 |
(_, _) => { |
| 117 |
return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo sqlx-core 0.8.3 error/Error#::Configurationrust-analyzer cargo sqlx-core 0.8.3 error/Error#Configuration#( |
| 118 |
"user auth key and certs must be given together".intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().(), |
| 119 |
)) |
| 120 |
} |
| 121 |
}; |
| 122 |
|
| 123 |
let config = if tls_config.accept_invalid_certsrust-analyzer cargo sqlx-core 0.8.3 net/tls/TlsConfig#accept_invalid_certs. { |
| 124 |
if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(user_auth) = user_auth { |
| 125 |
config |
| 126 |
.dangerousrust-analyzer cargo rustls 0.23.43 client/builder/impl#[`ConfigBuilder<ClientConfig, WantsVerifier>`]dangerous().() |
| 127 |
.with_custom_certificate_verifierrust-analyzer cargo rustls 0.23.43 client/builder/danger/impl#[DangerousClientConfigBuilder]with_custom_certificate_verifier().(Arcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/Arc#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/impl#[`Arc<T>`]new().(DummyTlsVerifierrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/DummyTlsVerifier# { providerrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/DummyTlsVerifier#provider. })) |
| 128 |
.with_client_auth_certrust-analyzer cargo rustls 0.23.43 client/builder/impl#[`ConfigBuilder<ClientConfig, WantsClientCert>`]with_client_auth_cert().(user_auth.0, user_auth.1) |
| 129 |
.map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(Errorrust-analyzer cargo sqlx-core 0.8.3 error/Error#::tlsrust-analyzer cargo sqlx-core 0.8.3 error/impl#[Error]tls().)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). |
| 130 |
} else { |
| 131 |
config |
| 132 |
.dangerousrust-analyzer cargo rustls 0.23.43 client/builder/impl#[`ConfigBuilder<ClientConfig, WantsVerifier>`]dangerous().() |
| 133 |
.with_custom_certificate_verifierrust-analyzer cargo rustls 0.23.43 client/builder/danger/impl#[DangerousClientConfigBuilder]with_custom_certificate_verifier().(Arcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/Arc#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/impl#[`Arc<T>`]new().(DummyTlsVerifierrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/DummyTlsVerifier# { providerrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/DummyTlsVerifier#provider. })) |
| 134 |
.with_no_client_authrust-analyzer cargo rustls 0.23.43 client/builder/impl#[`ConfigBuilder<ClientConfig, WantsClientCert>`]with_no_client_auth().() |
| 135 |
} |
| 136 |
} else { |
| •137 |
//#[cfg(any(feature = "_tls-rustls-aws-lc-rs", feature = "_tls-rustls-ring-webpki"))] |
| 138 |
//let mut cert_store = certs_from_webpki(); |
| 139 |
//#[cfg(feature = "_tls-rustls-ring-native-roots")] |
| 140 |
let mut cert_store = certs_from_native_storerust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/certs_from_native_store().(); |
| 141 |
|
| 142 |
if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(ca) = tls_config.root_cert_pathrust-analyzer cargo sqlx-core 0.8.3 net/tls/TlsConfig#root_cert_path. { |
| 143 |
let data = ca.datarust-analyzer cargo sqlx-core 0.8.3 net/tls/impl#[CertificateInput]data().().rust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll().awaitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 144 |
let mut cursor = Cursorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/cursor/Cursor#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/cursor/impl#[`Cursor<T>`]new().(data); |
| 145 |
|
| 146 |
for result in rustls_pemfilerust-analyzer cargo rustls-pemfile 2.2.0 crate/::certsrust-analyzer cargo rustls-pemfile 2.2.0 certs().(&mut cursor) { |
| 147 |
let Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(cert) = result else { |
| 148 |
return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo sqlx-core 0.8.3 error/Error#::Tlsrust-analyzer cargo sqlx-core 0.8.3 error/Error#Tls#(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("Invalid certificate {ca}").intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())); |
| 149 |
}; |
| 150 |
|
| 151 |
cert_store.addrust-analyzer cargo rustls 0.23.43 webpki/anchors/impl#[RootCertStore]add().(cert).map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|err| Errorrust-analyzer cargo sqlx-core 0.8.3 error/Error#::Tlsrust-analyzer cargo sqlx-core 0.8.3 error/Error#Tls#(err.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 152 |
} |
| 153 |
} |
| 154 |
|
| 155 |
if tls_config.accept_invalid_hostnamesrust-analyzer cargo sqlx-core 0.8.3 net/tls/TlsConfig#accept_invalid_hostnames. { |
| 156 |
let verifier = WebPkiServerVerifierrust-analyzer cargo rustls 0.23.43 webpki/server_verifier/WebPkiServerVerifier#::builderrust-analyzer cargo rustls 0.23.43 webpki/server_verifier/impl#[WebPkiServerVerifier]builder().(Arcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/Arc#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/impl#[`Arc<T>`]new().(cert_store)) |
| 157 |
.buildrust-analyzer cargo rustls 0.23.43 webpki/server_verifier/impl#[ServerCertVerifierBuilder]build().() |
| 158 |
.map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|err| Errorrust-analyzer cargo sqlx-core 0.8.3 error/Error#::Tlsrust-analyzer cargo sqlx-core 0.8.3 error/Error#Tls#(err.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 159 |
|
| 160 |
if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(user_auth) = user_auth { |
| 161 |
config |
| 162 |
.dangerousrust-analyzer cargo rustls 0.23.43 client/builder/impl#[`ConfigBuilder<ClientConfig, WantsVerifier>`]dangerous().() |
| 163 |
.with_custom_certificate_verifierrust-analyzer cargo rustls 0.23.43 client/builder/danger/impl#[DangerousClientConfigBuilder]with_custom_certificate_verifier().(Arcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/Arc#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/impl#[`Arc<T>`]new().(NoHostnameTlsVerifierrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/NoHostnameTlsVerifier# { verifierrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/NoHostnameTlsVerifier#verifier. })) |
| 164 |
.with_client_auth_certrust-analyzer cargo rustls 0.23.43 client/builder/impl#[`ConfigBuilder<ClientConfig, WantsClientCert>`]with_client_auth_cert().(user_auth.0, user_auth.1) |
| 165 |
.map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(Errorrust-analyzer cargo sqlx-core 0.8.3 error/Error#::tlsrust-analyzer cargo sqlx-core 0.8.3 error/impl#[Error]tls().)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). |
| 166 |
} else { |
| 167 |
config |
| 168 |
.dangerousrust-analyzer cargo rustls 0.23.43 client/builder/impl#[`ConfigBuilder<ClientConfig, WantsVerifier>`]dangerous().() |
| 169 |
.with_custom_certificate_verifierrust-analyzer cargo rustls 0.23.43 client/builder/danger/impl#[DangerousClientConfigBuilder]with_custom_certificate_verifier().(Arcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/Arc#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/impl#[`Arc<T>`]new().(NoHostnameTlsVerifierrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/NoHostnameTlsVerifier# { verifierrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/NoHostnameTlsVerifier#verifier. })) |
| 170 |
.with_no_client_authrust-analyzer cargo rustls 0.23.43 client/builder/impl#[`ConfigBuilder<ClientConfig, WantsClientCert>`]with_no_client_auth().() |
| 171 |
} |
| 172 |
} else if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(user_auth) = user_auth { |
| 173 |
config |
| 174 |
.with_root_certificatesrust-analyzer cargo rustls 0.23.43 client/builder/impl#[`ConfigBuilder<ClientConfig, WantsVerifier>`]with_root_certificates().(cert_store) |
| 175 |
.with_client_auth_certrust-analyzer cargo rustls 0.23.43 client/builder/impl#[`ConfigBuilder<ClientConfig, WantsClientCert>`]with_client_auth_cert().(user_auth.0, user_auth.1) |
| 176 |
.map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(Errorrust-analyzer cargo sqlx-core 0.8.3 error/Error#::tlsrust-analyzer cargo sqlx-core 0.8.3 error/impl#[Error]tls().)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch(). |
| 177 |
} else { |
| 178 |
config |
| 179 |
.with_root_certificatesrust-analyzer cargo rustls 0.23.43 client/builder/impl#[`ConfigBuilder<ClientConfig, WantsVerifier>`]with_root_certificates().(cert_store) |
| 180 |
.with_no_client_authrust-analyzer cargo rustls 0.23.43 client/builder/impl#[`ConfigBuilder<ClientConfig, WantsClientCert>`]with_no_client_auth().() |
| 181 |
} |
| 182 |
}; |
| 183 |
|
| 184 |
let host = ServerNamerust-analyzer cargo rustls-pki-types 1.15.1 server_name/ServerName#::try_fromrust-analyzer cargo rustls-pki-types 1.15.1 server_name/impl#[`ServerName<'static>`][`TryFrom<String>`]try_from().(tls_config.hostnamerust-analyzer cargo sqlx-core 0.8.3 net/tls/TlsConfig#hostname..to_ownedrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str][ToOwned]to_owned().()).map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(Errorrust-analyzer cargo sqlx-core 0.8.3 error/Error#::tlsrust-analyzer cargo sqlx-core 0.8.3 error/impl#[Error]tls().)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 185 |
|
| 186 |
let mut socket = RustlsSocketrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/RustlsSocket# { |
| 187 |
innerrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/RustlsSocket#inner.: StdSocketrust-analyzer cargo sqlx-core 0.8.3 net/tls/util/StdSocket#::newrust-analyzer cargo sqlx-core 0.8.3 net/tls/util/impl#[`StdSocket<S>`]new().(socket), |
| 188 |
staterust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/RustlsSocket#state.: ClientConnectionrust-analyzer cargo rustls 0.23.43 client/client_conn/connection/ClientConnection#::newrust-analyzer cargo rustls 0.23.43 client/client_conn/connection/impl#[ClientConnection]new().(Arcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/Arc#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/impl#[`Arc<T>`]new().(config), host).map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(Errorrust-analyzer cargo sqlx-core 0.8.3 error/Error#::tlsrust-analyzer cargo sqlx-core 0.8.3 error/impl#[Error]tls().)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()., |
| 189 |
close_notify_sentrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/RustlsSocket#close_notify_sent.: false, |
| 190 |
}; |
| 191 |
|
| 192 |
// Performs the TLS handshake or bails |
| 193 |
socket.complete_iorust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/impl#[`RustlsSocket<S>`]complete_io().().rust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll().awaitrust-analyzer cargo core https://github.com/rust-lang/rust/library/core future/future/Future#poll().?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 194 |
|
| 195 |
Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(socket) |
| 196 |
} |
| 197 |
|
| 198 |
fn certs_from_pemrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/certs_from_pem().(pem: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<CertificateDerrust-analyzer cargo rustls-pki-types 1.15.1 CertificateDer#<'static>>, Errorrust-analyzer cargo sqlx-core 0.8.3 error/Error#> { |
| 199 |
let cur = Cursorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/cursor/Cursor#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/cursor/impl#[`Cursor<T>`]new().(pem); |
| 200 |
let mut reader = BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(cur); |
| 201 |
rustls_pemfilerust-analyzer cargo rustls-pemfile 2.2.0 crate/::certsrust-analyzer cargo rustls-pemfile 2.2.0 certs().(&mut reader) |
| 202 |
.maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|result| result.map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|err| Errorrust-analyzer cargo sqlx-core 0.8.3 error/Error#::Tlsrust-analyzer cargo sqlx-core 0.8.3 error/Error#Tls#(err.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()))) |
| 203 |
.collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().() |
| 204 |
} |
| 205 |
|
| 206 |
fn private_key_from_pemrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/private_key_from_pem().(pem: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<PrivateKeyDerrust-analyzer cargo rustls-pki-types 1.15.1 PrivateKeyDer#<'static>, Errorrust-analyzer cargo sqlx-core 0.8.3 error/Error#> { |
| 207 |
let cur = Cursorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/cursor/Cursor#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/cursor/impl#[`Cursor<T>`]new().(pem); |
| 208 |
let mut reader = BufReaderrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/BufReader#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/buffered/bufreader/impl#[`BufReader<R>`]new().(cur); |
| 209 |
match rustls_pemfilerust-analyzer cargo rustls-pemfile 2.2.0 crate/::private_keyrust-analyzer cargo rustls-pemfile 2.2.0 private_key().(&mut reader) { |
| 210 |
Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(key)) => Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(key), |
| 211 |
Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#) => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo sqlx-core 0.8.3 error/Error#::Configurationrust-analyzer cargo sqlx-core 0.8.3 error/Error#Configuration#("no keys found pem file".intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())), |
| 212 |
Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(e) => Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo sqlx-core 0.8.3 error/Error#::Configurationrust-analyzer cargo sqlx-core 0.8.3 error/Error#Configuration#(e.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().().intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().())), |
| 213 |
} |
| 214 |
} |
| 215 |
|
| •216 |
/*#[cfg(any(feature = "_tls-rustls-aws-lc-rs", feature = "_tls-rustls-ring-webpki"))] |
| 217 |
fn certs_from_webpki() -> RootCertStore { |
| 218 |
RootCertStore::from_iter(webpki_roots::TLS_SERVER_ROOTS.iter().cloned()) |
| •219 |
}*/ |
| 220 |
|
| •221 |
//#[cfg(feature = "_tls-rustls-ring-native-roots")] |
| 222 |
fn certs_from_native_storerust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/certs_from_native_store().() -> RootCertStorerust-analyzer cargo rustls 0.23.43 webpki/anchors/RootCertStore# { |
| 223 |
let mut root_cert_store = RootCertStorerust-analyzer cargo rustls 0.23.43 webpki/anchors/RootCertStore#::emptyrust-analyzer cargo rustls 0.23.43 webpki/anchors/impl#[RootCertStore]empty().(); |
| 224 |
|
| 225 |
let load_results = rustls_native_certsrust-analyzer cargo rustls-native-certs 0.8.4 crate/::load_native_certsrust-analyzer cargo rustls-native-certs 0.8.4 load_native_certs().(); |
| 226 |
for e in load_results.errorsrust-analyzer cargo rustls-native-certs 0.8.4 CertificateResult#errors. { |
| 227 |
logrust-analyzer cargo log 0.4.34 crate/::warnrust-analyzer cargo log 0.4.34 macros/warn!!("Error loading native certificates: {e:?}"); |
| 228 |
} |
| 229 |
for cert in load_results.certsrust-analyzer cargo rustls-native-certs 0.8.4 CertificateResult#certs. { |
| 230 |
if let Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(e) = root_cert_store.addrust-analyzer cargo rustls 0.23.43 webpki/anchors/impl#[RootCertStore]add().(cert.intorust-analyzer cargo core https://github.com/rust-lang/rust/library/core convert/impl#[T][`Into<U>`]into().()) { |
| 231 |
logrust-analyzer cargo log 0.4.34 crate/::warnrust-analyzer cargo log 0.4.34 macros/warn!!("rustls failed to parse native certificate: {e:?}"); |
| 232 |
} |
| 233 |
} |
| 234 |
|
| 235 |
root_cert_store |
| 236 |
} |
| 237 |
|
| 238 |
#[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)] |
| 239 |
struct DummyTlsVerifierrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/DummyTlsVerifier# { |
| 240 |
providerrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/DummyTlsVerifier#provider.: Arcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/Arc#<CryptoProviderrust-analyzer cargo rustls 0.23.43 crypto/CryptoProvider#>, |
| 241 |
} |
| 242 |
|
| 243 |
impl ServerCertVerifierrust-analyzer cargo rustls 0.23.43 verify/ServerCertVerifier# for DummyTlsVerifierrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/DummyTlsVerifier# { |
| 244 |
fn verify_server_certrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/impl#[DummyTlsVerifier][ServerCertVerifier]verify_server_cert().( |
| 245 |
&self, |
| 246 |
_end_entity: &CertificateDerrust-analyzer cargo rustls-pki-types 1.15.1 CertificateDer#<'_>, |
| 247 |
_intermediates: &[CertificateDerrust-analyzer cargo rustls-pki-types 1.15.1 CertificateDer#<'_>], |
| 248 |
_server_name: &ServerNamerust-analyzer cargo rustls-pki-types 1.15.1 server_name/ServerName#<'_>, |
| 249 |
_ocsp_response: &[u8], |
| 250 |
_now: UnixTimerust-analyzer cargo rustls-pki-types 1.15.1 UnixTime#, |
| 251 |
) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<ServerCertVerifiedrust-analyzer cargo rustls 0.23.43 verify/ServerCertVerified#, TlsErrorrust-analyzer cargo rustls 0.23.43 error/Error#> { |
| 252 |
Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(ServerCertVerifiedrust-analyzer cargo rustls 0.23.43 verify/ServerCertVerified#::assertionrust-analyzer cargo rustls 0.23.43 verify/impl#[ServerCertVerified]assertion().()) |
| 253 |
} |
| 254 |
|
| 255 |
fn verify_tls12_signaturerust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/impl#[DummyTlsVerifier][ServerCertVerifier]verify_tls12_signature().( |
| 256 |
&self, |
| 257 |
message: &[u8], |
| 258 |
cert: &CertificateDerrust-analyzer cargo rustls-pki-types 1.15.1 CertificateDer#<'_>, |
| 259 |
dss: &rustlsrust-analyzer cargo rustls 0.23.43 crate/::DigitallySignedStructrust-analyzer cargo rustls 0.23.43 verify/DigitallySignedStruct#, |
| 260 |
) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<rustlsrust-analyzer cargo rustls 0.23.43 crate/::clientrust-analyzer cargo rustls 0.23.43 client/::dangerrust-analyzer cargo rustls 0.23.43 client/danger/::HandshakeSignatureValidrust-analyzer cargo rustls 0.23.43 verify/HandshakeSignatureValid#, TlsErrorrust-analyzer cargo rustls 0.23.43 error/Error#> { |
| 261 |
verify_tls12_signaturerust-analyzer cargo rustls 0.23.43 webpki/verify/verify_tls12_signature().( |
| 262 |
message, |
| 263 |
cert, |
| 264 |
dss, |
| 265 |
&self.providerrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/DummyTlsVerifier#provider..signature_verification_algorithmsrust-analyzer cargo rustls 0.23.43 crypto/CryptoProvider#signature_verification_algorithms., |
| 266 |
) |
| 267 |
} |
| 268 |
|
| 269 |
fn verify_tls13_signaturerust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/impl#[DummyTlsVerifier][ServerCertVerifier]verify_tls13_signature().( |
| 270 |
&self, |
| 271 |
message: &[u8], |
| 272 |
cert: &CertificateDerrust-analyzer cargo rustls-pki-types 1.15.1 CertificateDer#<'_>, |
| 273 |
dss: &rustlsrust-analyzer cargo rustls 0.23.43 crate/::DigitallySignedStructrust-analyzer cargo rustls 0.23.43 verify/DigitallySignedStruct#, |
| 274 |
) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<rustlsrust-analyzer cargo rustls 0.23.43 crate/::clientrust-analyzer cargo rustls 0.23.43 client/::dangerrust-analyzer cargo rustls 0.23.43 client/danger/::HandshakeSignatureValidrust-analyzer cargo rustls 0.23.43 verify/HandshakeSignatureValid#, TlsErrorrust-analyzer cargo rustls 0.23.43 error/Error#> { |
| 275 |
verify_tls13_signaturerust-analyzer cargo rustls 0.23.43 webpki/verify/verify_tls13_signature().( |
| 276 |
message, |
| 277 |
cert, |
| 278 |
dss, |
| 279 |
&self.providerrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/DummyTlsVerifier#provider..signature_verification_algorithmsrust-analyzer cargo rustls 0.23.43 crypto/CryptoProvider#signature_verification_algorithms., |
| 280 |
) |
| 281 |
} |
| 282 |
|
| 283 |
fn supported_verify_schemesrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/impl#[DummyTlsVerifier][ServerCertVerifier]supported_verify_schemes().(&self) -> Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<rustlsrust-analyzer cargo rustls 0.23.43 crate/::SignatureSchemerust-analyzer cargo rustls 0.23.43 enums/SignatureScheme#> { |
| 284 |
self.providerrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/DummyTlsVerifier#provider. |
| 285 |
.signature_verification_algorithmsrust-analyzer cargo rustls 0.23.43 crypto/CryptoProvider#signature_verification_algorithms. |
| 286 |
.supported_schemesrust-analyzer cargo rustls 0.23.43 webpki/verify/impl#[WebPkiSupportedAlgorithms]supported_schemes().() |
| 287 |
} |
| 288 |
} |
| 289 |
|
| 290 |
#[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)] |
| 291 |
pub struct NoHostnameTlsVerifierrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/NoHostnameTlsVerifier# { |
| 292 |
verifierrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/NoHostnameTlsVerifier#verifier.: Arcrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc sync/Arc#<WebPkiServerVerifierrust-analyzer cargo rustls 0.23.43 webpki/server_verifier/WebPkiServerVerifier#>, |
| 293 |
} |
| 294 |
|
| 295 |
impl ServerCertVerifierrust-analyzer cargo rustls 0.23.43 verify/ServerCertVerifier# for NoHostnameTlsVerifierrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/NoHostnameTlsVerifier# { |
| 296 |
fn verify_server_certrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/impl#[NoHostnameTlsVerifier][ServerCertVerifier]verify_server_cert().( |
| 297 |
&self, |
| 298 |
end_entity: &CertificateDerrust-analyzer cargo rustls-pki-types 1.15.1 CertificateDer#<'_>, |
| 299 |
intermediates: &[CertificateDerrust-analyzer cargo rustls-pki-types 1.15.1 CertificateDer#<'_>], |
| 300 |
server_name: &ServerNamerust-analyzer cargo rustls-pki-types 1.15.1 server_name/ServerName#<'_>, |
| 301 |
ocsp_response: &[u8], |
| 302 |
now: UnixTimerust-analyzer cargo rustls-pki-types 1.15.1 UnixTime#, |
| 303 |
) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<ServerCertVerifiedrust-analyzer cargo rustls 0.23.43 verify/ServerCertVerified#, TlsErrorrust-analyzer cargo rustls 0.23.43 error/Error#> { |
| 304 |
match self.verifierrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/NoHostnameTlsVerifier#verifier..verify_server_certrust-analyzer cargo rustls 0.23.43 webpki/server_verifier/impl#[WebPkiServerVerifier][ServerCertVerifier]verify_server_cert().( |
| 305 |
end_entity, |
| 306 |
intermediates, |
| 307 |
server_name, |
| 308 |
ocsp_response, |
| 309 |
now, |
| 310 |
) { |
| 311 |
Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(TlsErrorrust-analyzer cargo rustls 0.23.43 error/Error#::InvalidCertificaterust-analyzer cargo rustls 0.23.43 error/Error#InvalidCertificate#(CertificateErrorrust-analyzer cargo rustls 0.23.43 error/CertificateError#::NotValidForNamerust-analyzer cargo rustls 0.23.43 error/CertificateError#NotValidForName#)) => { |
| 312 |
Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(ServerCertVerifiedrust-analyzer cargo rustls 0.23.43 verify/ServerCertVerified#::assertionrust-analyzer cargo rustls 0.23.43 verify/impl#[ServerCertVerified]assertion().()) |
| 313 |
} |
| 314 |
res => res, |
| 315 |
} |
| 316 |
} |
| 317 |
|
| 318 |
fn verify_tls12_signaturerust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/impl#[NoHostnameTlsVerifier][ServerCertVerifier]verify_tls12_signature().( |
| 319 |
&self, |
| 320 |
message: &[u8], |
| 321 |
cert: &CertificateDerrust-analyzer cargo rustls-pki-types 1.15.1 CertificateDer#<'_>, |
| 322 |
dss: &rustlsrust-analyzer cargo rustls 0.23.43 crate/::DigitallySignedStructrust-analyzer cargo rustls 0.23.43 verify/DigitallySignedStruct#, |
| 323 |
) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<rustlsrust-analyzer cargo rustls 0.23.43 crate/::clientrust-analyzer cargo rustls 0.23.43 client/::dangerrust-analyzer cargo rustls 0.23.43 client/danger/::HandshakeSignatureValidrust-analyzer cargo rustls 0.23.43 verify/HandshakeSignatureValid#, TlsErrorrust-analyzer cargo rustls 0.23.43 error/Error#> { |
| 324 |
self.verifierrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/NoHostnameTlsVerifier#verifier..verify_tls12_signaturerust-analyzer cargo rustls 0.23.43 webpki/server_verifier/impl#[WebPkiServerVerifier][ServerCertVerifier]verify_tls12_signature().(message, cert, dss) |
| 325 |
} |
| 326 |
|
| 327 |
fn verify_tls13_signaturerust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/impl#[NoHostnameTlsVerifier][ServerCertVerifier]verify_tls13_signature().( |
| 328 |
&self, |
| 329 |
message: &[u8], |
| 330 |
cert: &CertificateDerrust-analyzer cargo rustls-pki-types 1.15.1 CertificateDer#<'_>, |
| 331 |
dss: &rustlsrust-analyzer cargo rustls 0.23.43 crate/::DigitallySignedStructrust-analyzer cargo rustls 0.23.43 verify/DigitallySignedStruct#, |
| 332 |
) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<rustlsrust-analyzer cargo rustls 0.23.43 crate/::clientrust-analyzer cargo rustls 0.23.43 client/::dangerrust-analyzer cargo rustls 0.23.43 client/danger/::HandshakeSignatureValidrust-analyzer cargo rustls 0.23.43 verify/HandshakeSignatureValid#, TlsErrorrust-analyzer cargo rustls 0.23.43 error/Error#> { |
| 333 |
self.verifierrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/NoHostnameTlsVerifier#verifier..verify_tls13_signaturerust-analyzer cargo rustls 0.23.43 webpki/server_verifier/impl#[WebPkiServerVerifier][ServerCertVerifier]verify_tls13_signature().(message, cert, dss) |
| 334 |
} |
| 335 |
|
| 336 |
fn supported_verify_schemesrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/impl#[NoHostnameTlsVerifier][ServerCertVerifier]supported_verify_schemes().(&self) -> Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<rustlsrust-analyzer cargo rustls 0.23.43 crate/::SignatureSchemerust-analyzer cargo rustls 0.23.43 enums/SignatureScheme#> { |
| 337 |
self.verifierrust-analyzer cargo sqlx-core 0.8.3 net/tls/tls_rustls/NoHostnameTlsVerifier#verifier..supported_verify_schemesrust-analyzer cargo rustls 0.23.43 webpki/server_verifier/impl#[WebPkiServerVerifier][ServerCertVerifier]supported_verify_schemes().() |
| 338 |
} |
| 339 |
} |