summaryrefslogtreecommitdiffstats
path: root/rpc/rpc-transport/socket
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2014-09-23 07:46:16 +0200
committerVijay Bellur <vbellur@redhat.com>2014-09-26 03:32:42 -0700
commit3d36edb00c2adad9a957a445aafac3e800964bb1 (patch)
tree4530c0d26e06f02ab44ca982f62684c4097a7699 /rpc/rpc-transport/socket
parent8e57090f7da4027c46176c9786372a00e22df69d (diff)
Use sane OS-dependent defaults for SSL configuration
Current code assumes /etc/ssl exists, which may not be the case. Attempt to guess sane default for a few OS. BUG: 1129939 Change-Id: I0f3168f79b8f4275636581041740dfcaf25f3edd Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/8790 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'rpc/rpc-transport/socket')
-rw-r--r--rpc/rpc-transport/socket/src/socket.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c
index c1ad8ec9278..c7cc37bf950 100644
--- a/rpc/rpc-transport/socket/src/socket.c
+++ b/rpc/rpc-transport/socket/src/socket.c
@@ -46,14 +46,28 @@
#define OWN_THREAD_OPT "transport.socket.own-thread"
/* TBD: do automake substitutions etc. (ick) to set these. */
+#if !defined(DEFAULT_ETC_SSL)
+# ifdef GF_LINUX_HOST_OS
+# define DEFAULT_ETC_SSL "/etc/ssl"
+# endif
+# ifdef GF_BSD_HOST_OS
+# define DEFAULT_ETC_SSL "/etc/openssl"
+# endif
+# ifdef GF_DARWIN_HOST_OS
+# define DEFAULT_ETC_SSL "/opt/local/etc/openssl"
+# endif
+# if !defined(DEFAULT_ETC_SSL)
+# define DEFAULT_ETC_SSL "/etc/ssl"
+# endif
+#endif
#if !defined(DEFAULT_CERT_PATH)
-#define DEFAULT_CERT_PATH "/etc/ssl/glusterfs.pem"
+#define DEFAULT_CERT_PATH DEFAULT_ETC_SSL "/glusterfs.pem"
#endif
#if !defined(DEFAULT_KEY_PATH)
-#define DEFAULT_KEY_PATH "/etc/ssl/glusterfs.key"
+#define DEFAULT_KEY_PATH DEFAULT_ETC_SSL "/glusterfs.key"
#endif
#if !defined(DEFAULT_CA_PATH)
-#define DEFAULT_CA_PATH "/etc/ssl/glusterfs.ca"
+#define DEFAULT_CA_PATH DEFAULT_ETC_SSL "/glusterfs.ca"
#endif
#define POLL_MASK_INPUT (POLLIN | POLLPRI)