Take port from SNI, formatting, make clippy happy

This commit is contained in:
Alexey Kondratov
2023-04-27 12:45:54 +02:00
committed by Stas Kelvich
parent 556fb1642a
commit 81c75586ab
4 changed files with 44 additions and 18 deletions

View File

@@ -1,6 +1,9 @@
///! A group of high-level tests for connection establishing logic and auth.
use super::*;
use crate::config::TlsConfig;
use crate::{auth, sasl, scram};
use async_trait::async_trait;
use rstest::rstest;
use tokio_postgres::config::SslMode;
@@ -133,7 +136,11 @@ async fn dummy_proxy(
auth: impl TestAuth + Send,
) -> anyhow::Result<()> {
let cancel_map = CancelMap::default();
let (mut stream, _params) = handshake(client, tls.as_ref(), &cancel_map)
let server_config = match tls {
Some(tls) => Some(tls.config),
None => None,
};
let (mut stream, _params) = handshake(client, server_config, &cancel_map)
.await?
.context("handshake failed")?;