File tree Expand file tree Collapse file tree 5 files changed +10
-8
lines changed Expand file tree Collapse file tree 5 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -249,7 +249,7 @@ where
249
249
250
250
// Establish TLS connection with server
251
251
252
- let server_stream = crate :: tls:: connect ( selected_target. host ( ) , server_stream)
252
+ let server_stream = crate :: tls:: connect ( selected_target. host ( ) . to_owned ( ) , server_stream)
253
253
. await
254
254
. context ( "TLS connect" )
255
255
. map_err ( ForwardError :: BadGateway ) ?;
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ async fn handle_socket(
69
69
Duration :: from_secs ( conf. debug . ws_keep_alive_interval ) ,
70
70
) ;
71
71
72
- let result = crate :: rdp_extension :: handle (
72
+ let result = crate :: rd_clean_path :: handle (
73
73
stream,
74
74
source_addr,
75
75
conf,
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ pub mod middleware;
28
28
pub mod ngrok;
29
29
pub mod plugin_manager;
30
30
pub mod proxy;
31
- pub mod rdp_extension ;
31
+ pub mod rd_clean_path ;
32
32
pub mod rdp_pcb;
33
33
pub mod recording;
34
34
pub mod session;
Original file line number Diff line number Diff line change @@ -237,7 +237,7 @@ async fn process_cleanpath(
237
237
238
238
// Establish TLS connection with server
239
239
240
- let server_stream = crate :: tls:: connect ( selected_target. host ( ) , server_stream)
240
+ let server_stream = crate :: tls:: connect ( selected_target. host ( ) . to_owned ( ) , server_stream)
241
241
. await
242
242
. map_err ( |source| CleanPathError :: TlsHandshake {
243
243
source,
@@ -321,7 +321,7 @@ pub async fn handle(
321
321
. recording_policy ( claims. jet_rec )
322
322
. build ( ) ;
323
323
324
- info ! ( "RDP-TLS forwarding" ) ;
324
+ info ! ( "RDP-TLS forwarding (RDCleanPath) " ) ;
325
325
326
326
Proxy :: builder ( )
327
327
. conf ( conf)
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ use std::io;
2
2
use std:: sync:: { Arc , LazyLock } ;
3
3
4
4
use anyhow:: Context as _;
5
- use tokio:: net:: TcpStream ;
6
5
use tokio_rustls:: client:: TlsStream ;
7
6
use tokio_rustls:: rustls:: { self , pki_types} ;
8
7
@@ -32,10 +31,13 @@ static TLS_CONNECTOR: LazyLock<tokio_rustls::TlsConnector> = LazyLock::new(|| {
32
31
tokio_rustls:: TlsConnector :: from ( Arc :: new ( config) )
33
32
} ) ;
34
33
35
- pub async fn connect ( dns_name : & str , stream : TcpStream ) -> io:: Result < TlsStream < TcpStream > > {
34
+ pub async fn connect < IO > ( dns_name : String , stream : IO ) -> io:: Result < TlsStream < IO > >
35
+ where
36
+ IO : tokio:: io:: AsyncRead + tokio:: io:: AsyncWrite + Unpin ,
37
+ {
36
38
use tokio:: io:: AsyncWriteExt as _;
37
39
38
- let dns_name = pki_types:: ServerName :: try_from ( dns_name. to_owned ( ) ) . map_err ( io:: Error :: other) ?;
40
+ let dns_name = pki_types:: ServerName :: try_from ( dns_name) . map_err ( io:: Error :: other) ?;
39
41
40
42
let mut tls_stream = TLS_CONNECTOR . connect ( dns_name, stream) . await ?;
41
43
You can’t perform that action at this time.
0 commit comments