From a935132099af20a8a742d30f8edcb613e73a368d Mon Sep 17 00:00:00 2001 From: Geoff Thorpe Date: Sat, 26 Apr 2014 01:22:54 -0400 Subject: s_client/s_server: support unix domain sockets The "-unix " argument allows s_server and s_client to use a unix domain socket in the filesystem instead of IPv4 ("-connect", "-port", "-accept", etc). If s_server exits gracefully, such as when "-naccept" is used and the requested number of SSL/TLS connections have occurred, then the domain socket file is removed. On ctrl-C, it is likely that the stale socket file will be left over, such that s_server would normally fail to restart with the same arguments. For this reason, s_server also supports an "-unlink" option, which will clean up any stale socket file before starting. If you have any reason to want encrypted IPC within an O/S instance, this concept might come in handy. Otherwise it just demonstrates that there is nothing about SSL/TLS that limits it to TCP/IP in any way. (There might also be benchmarking and profiling use in this path, as unix domain sockets are much lower overhead than connecting over local IP addresses). Signed-off-by: Geoff Thorpe --- e_os.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'e_os.h') diff --git a/e_os.h b/e_os.h index c5ed54f3b2..4440ac28d7 100644 --- a/e_os.h +++ b/e_os.h @@ -579,6 +579,16 @@ static unsigned int _strlen31(const char *str) # include # else # include +# ifndef NO_SYS_UN_H +# ifdef OPENSSL_SYS_VXWORKS +# include +# else +# include +# endif +# ifndef UNIX_PATH_MAX +# define UNIX_PATH_MAX sizeof(((struct sockaddr_un *)NULL)->sun_path) +# endif +# endif # ifdef FILIO_H # include /* Added for FIONBIO under unixware */ # endif -- cgit v1.2.3