HTHou commented on code in PR #3638:
URL: https://github.com/apache/thrift/pull/3638#discussion_r3594716150


##########
test/rs/src/bin/test_client.rs:
##########
@@ -87,10 +97,20 @@ fn run() -> thrift::Result<()> {
         None => {
             let listen_address = format!("{}:{}", host, port);
             info!(
-                "Client binds to {} with {}+{} stack",
-                listen_address, protocol, transport
+                "Client connects to {} with {}+{}{} stack",
+                listen_address,
+                protocol,
+                transport,
+                if ssl { "+tls" } else { "" }
             );
-            bind(listen_address.as_str(), protocol, transport)?
+            let tls = if ssl {
+                let server_name = ServerName::try_from(host.to_owned())
+                    .map_err(|e| format!("invalid TLS server name {host:?}: 
{e}"))?;
+                Some((server_name, tls_config()))
+            } else {
+                None
+            };

Review Comment:
   `ServerName::try_from("127.0.0.1".to_owned())` produces 
`ServerName::IpAddress`, which rustls supports; it omits the SNI extension for 
IP addresses. The cross-test verifier intentionally skips certificate-name 
validation to match the other bindings, so the certificate name `localhost` is 
not used here (TLS handshake signatures are still verified). The `ip-ssl` 
cross-tests pass with the default `127.0.0.1` host, without `--host=localhost`, 
so no code change is needed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to