apps: Don't print hostname on bio_out during connect.
authorSebastian Andrzej Siewior <sebastian@breakpoint.cc>
Thu, 14 Dec 2023 19:53:35 +0000 (20:53 +0100)
committerTomas Mraz <tomas@openssl.org>
Fri, 29 Dec 2023 10:50:18 +0000 (11:50 +0100)
Printing the hostname on bio_out clutters the output and breaks
pipe like forwarding via openssl.

Print the hostname via bio_err.

Fixes #23013

Signed-off-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23056)

apps/lib/s_socket.c

index 014c1c0bc0eceba70c5b1cc00acdd8292246b672..ace51686addc4f1b2ee263cfa58510a08ee99d29 100644 (file)
@@ -208,7 +208,7 @@ int init_client(int *sock, const char *host, const char *port,
 
         hostname = BIO_ADDR_hostname_string(BIO_ADDRINFO_address(ai), 1);
         if (hostname != NULL) {
-            BIO_printf(bio_out, "Connecting to %s\n", hostname);
+            BIO_printf(bio_err, "Connecting to %s\n", hostname);
             OPENSSL_free(hostname);
         }
         /* Remove any stale errors from previous connection attempts */