diff --git a/Makefile b/Makefile index b39beeb54953a752e19571dcf5de1d19096c0848..b018febea10a3ecf8fbcf7e0876e86604e2c2ec5 100644 --- a/Makefile +++ b/Makefile @@ -1930,7 +1930,7 @@ $(OBJDIR)/$(CONFIG)/%.o : %.cc $(Q) $(CXX) $(CXXFLAGS) $(CPPFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< -install: install_c install_cxx install-plugins verify-install +install: install_c install_cxx install-plugins install-certs verify-install install_c: install-headers_c install-static_c install-shared_c @@ -2074,6 +2074,11 @@ else $(Q) $(INSTALL) $(BINDIR)/$(CONFIG)/grpc_ruby_plugin $(prefix)/bin/grpc_ruby_plugin endif +install-certs: etc/roots.pem + $(E) "[INSTALL] Installing root certificates" + $(Q) $(INSTALL) -d $(prefix)/share/grpc + $(Q) $(INSTALL) etc/roots.pem $(prefix)/share/grpc/roots.pem + verify-install: ifeq ($(SYSTEM_OK),true) @echo "Your system looks ready to go." diff --git a/src/core/security/security_context.c b/src/core/security/security_context.c index ab3e0762b827a99ceb280dd41c2918f792bddd72..fd8baff539d4cf4b0e2a80bda4a2196f260b6cd1 100644 --- a/src/core/security/security_context.c +++ b/src/core/security/security_context.c @@ -61,9 +61,9 @@ "SHA256:AES256-SHA256" #ifndef INSTALL_PREFIX -static const char *installed_roots_path = "/etc/grpc/roots.pem"; +static const char *installed_roots_path = "/usr/share/grpc/roots.pem"; #else -static const char *installed_roots_path = INSTALL_PREFIX "/etc/grpc/roots.pem"; +static const char *installed_roots_path = INSTALL_PREFIX "/share/grpc/roots.pem"; #endif /* -- Common methods. -- */ diff --git a/templates/Makefile.template b/templates/Makefile.template index a93e23638df1292000dce387ceb0a2e53ff8bc8b..22b382cdab4db85232b8c75eaa2df1ff4fea324b 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -729,7 +729,7 @@ $(OBJDIR)/$(CONFIG)/%.o : %.cc $(Q) $(CXX) $(CXXFLAGS) $(CPPFLAGS) -MMD -MF $(addsuffix .dep, $(basename $@)) -c -o $@ $< -install: install_c install_cxx install-plugins verify-install +install: install_c install_cxx install-plugins install-certs verify-install install_c: install-headers_c install-static_c install-shared_c @@ -824,6 +824,11 @@ else % endfor endif +install-certs: etc/roots.pem + $(E) "[INSTALL] Installing root certificates" + $(Q) $(INSTALL) -d $(prefix)/share/grpc + $(Q) $(INSTALL) etc/roots.pem $(prefix)/share/grpc/roots.pem + verify-install: ifeq ($(SYSTEM_OK),true) @echo "Your system looks ready to go."