OpenSSL s_server with GoodMorning message in clear text

Matthias Apitz guru at unixarea.de
Tue Sep 26 12:58:16 UTC 2023


El día martes, septiembre 26, 2023 a las 01:35:42 +0200, Tomas Mraz escribió:

> In s_client there is already the -starttls option that does this on the
> client side. So you could implement the -starttls option similarly on
> the server side.
> 
> Tomas Mraz, OpenSSL

I did a fast change, only for testing the idea, and it works fine:

diff -c apps/lib/s_socket.c.orig apps/lib/s_socket.c
*** apps/lib/s_socket.c.orig    2023-09-26 13:06:50.997732542 +0200
--- apps/lib/s_socket.c 2023-09-26 13:37:21.767996821 +0200
***************
*** 381,386 ****
--- 381,390 ----
                  break;
              }
              BIO_set_tcp_ndelay(sock, 1);
+           fprintf(stderr, "sending GoodMorning message to socket %d\n", sock);
+           fflush(stderr);
+ #define GM "220 SLNP OpenSSL at version:V7.3 at user:sisis at pid:5234 at charset:UTF-8 at ssl:true\n"
+           write(sock, GM, strlen(GM));
              i = (*cb)(sock, type, protocol, context);

              /*

	matthias

-- 
Matthias Apitz, ✉ guru at unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub


More information about the openssl-users mailing list