diff -urN libreoffice-6.2.3.2-orig/Repository.mk libreoffice-6.2.3.2/Repository.mk
--- libreoffice-6.2.3.2-orig/Repository.mk	2019-04-10 19:10:51 +0900
+++ libreoffice-6.2.3.2/Repository.mk	2019-04-23 08:55:13 +0900
@@ -388,7 +388,7 @@
 	hyphen \
     icg \
 	$(if $(ENABLE_JAVA),jdbc) \
-	ldapbe2 \
+	$(if $(ENABLE_NSS),ldapbe2) \
 	$(if $(filter WNT,$(OS)),WinUserInfoBe) \
 	localebe1 \
 	log \
@@ -637,8 +637,10 @@
 	ucphier1 \
 	ucppkg1 \
 	unopkgapp \
-	xmlsecurity \
-	xsec_xmlsec \
+	$(if $(ENABLE_NSS), \
+		xmlsecurity \
+		xsec_xmlsec \
+	) \
 	xstor \
 	$(if $(filter $(OS),MACOSX), \
 		macab1 \
diff -urN libreoffice-6.2.3.2-orig/RepositoryExternal.mk libreoffice-6.2.3.2/RepositoryExternal.mk
--- libreoffice-6.2.3.2-orig/RepositoryExternal.mk	2019-04-10 19:10:51 +0900
+++ libreoffice-6.2.3.2/RepositoryExternal.mk	2019-04-23 08:55:13 +0900
@@ -955,6 +955,8 @@
 endif # SYSTEM_LIBXSLT
 
 
+ifeq ($(ENABLE_NSS),TRUE)
+
 ifneq ($(SYSTEM_XMLSEC),)
 
 define gb_LinkTarget__use_xmlsec
@@ -983,6 +985,8 @@
 
 endif # SYSTEM_XMLSEC
 
+endif # ENABLE_NSS
+
 ifneq ($(SYSTEM_LIBLANGTAG),)
 
 define gb_LinkTarget__use_liblangtag
@@ -2429,8 +2433,6 @@
 
 endef
 
-ifeq ($(OS),ANDROID)
-
 define gb_LinkTarget__use_lcms2
 $(call gb_LinkTarget_use_package,$(1),lcms2)
 $(call gb_LinkTarget_set_include,$(1),\
@@ -3399,6 +3401,8 @@
 gb_ExternalProject__use_nss3:=
 
 
+ifneq ($(ENABLE_NSS),TRUE)
+
 ifneq ($(SYSTEM_NSS),)
 
 define gb_LinkTarget__use_nss3
@@ -3493,6 +3497,8 @@
 
 endif # SYSTEM_NSS
 
+endif # ENABLE_NSS
+
 ifeq ($(ENABLE_BREAKPAD),TRUE)
 
 define gb_LinkTarget__use_breakpad
diff -urN libreoffice-6.2.3.2-orig/configure.ac libreoffice-6.2.3.2/configure.ac
--- libreoffice-6.2.3.2-orig/configure.ac	2019-04-10 19:10:51 +0900
+++ libreoffice-6.2.3.2/configure.ac	2019-04-23 08:55:13 +0900
@@ -1478,6 +1478,12 @@
         [MACOSX only: on MacOSX pkg-config can cause trouble. by default if one is found in the PATH, an error is issued. This flag turn that error into a warning.]),
 )
 
+AC_ARG_ENABLE(nss,
+    AS_HELP_STRING([--disable-nss],
+        [Disable using NSS for encryption. If disabled, components
+         will either use OpenSSL or GNUTLS.]),
+,enable_nss=yes)
+
 AC_ARG_ENABLE(openssl,
     AS_HELP_STRING([--disable-openssl],
         [Disable using libssl/libcrypto from OpenSSL. If disabled,
@@ -8003,7 +8009,9 @@
 dnl ===================================================================
 dnl Check for system xmlsec
 dnl ===================================================================
-libo_CHECK_SYSTEM_MODULE([xmlsec], [XMLSEC], [xmlsec1-nss >= 1.2.24])
+if test "$enable_nss" != "no"; then
+    libo_CHECK_SYSTEM_MODULE([xmlsec], [XMLSEC], [xmlsec1-nss >= 1.2.24])
+fi
 
 AC_MSG_CHECKING([whether to enable Embedded OpenType support])
 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_eot" = "yes"; then
@@ -9089,7 +9097,7 @@
 dnl ===================================================================
 dnl Check for system NSS
 dnl ===================================================================
-if test $_os != iOS -a "$enable_fuzzers" != "yes"; then
+if test $_os != iOS -a "$enable_fuzzers" != "yes" -a "$enable_nss" != "no"; then
     libo_CHECK_SYSTEM_MODULE([nss],[NSS],[nss >= 3.9.3 nspr >= 4.8])
     AC_DEFINE(HAVE_FEATURE_NSS)
     ENABLE_NSS="TRUE"
@@ -10560,7 +10568,7 @@
 elif test "$enable_fuzzers" = "yes"; then
     AC_MSG_CHECKING([whether gpgmepp should be disabled due to oss-fuzz])
     AC_MSG_RESULT([yes])
-elif test "$_os" = "Linux" -o "$_os" = "Darwin" -o "$_os" = "WINNT" ; then
+elif test \( "$_os" = "Linux" -o "$_os" = "Darwin" -o "$_os" = "WINNT" \) -a "$enable_nss" != "no"; then
     dnl ===================================================================
     dnl Check for system gpgme
     dnl ===================================================================
diff -urN libreoffice-6.2.3.2-orig/extensions/Module_extensions.mk libreoffice-6.2.3.2/extensions/Module_extensions.mk
--- libreoffice-6.2.3.2-orig/extensions/Module_extensions.mk	2019-04-10 19:10:51 +0900
+++ libreoffice-6.2.3.2/extensions/Module_extensions.mk	2019-04-23 08:57:54 +0900
@@ -13,10 +13,15 @@
 	AllLangMoTarget_pcr \
 ))
 
+ifeq ($(ENABLE_NSS),TRUE)
+$(eval $(call gb_Module_add_targets,extensions,\
+	Library_ldapbe2 \
+))
+endif
+
 ifneq ($(filter-out iOS ANDROID,$(OS)),)
 $(eval $(call gb_Module_add_targets,extensions,\
 	Library_abp \
-	Library_ldapbe2 \
 	$(if $(filter WNT,$(OS)),Library_WinUserInfoBe) \
 	Library_log \
 	Library_scn \
diff -urN libreoffice-6.2.3.2-orig/postprocess/Rdb_services.mk libreoffice-6.2.3.2/postprocess/Rdb_services.mk
--- libreoffice-6.2.3.2-orig/postprocess/Rdb_services.mk	2019-04-10 19:10:51 +0900
+++ libreoffice-6.2.3.2/postprocess/Rdb_services.mk	2019-04-23 08:55:13 +0900
@@ -298,7 +298,7 @@
 	desktop/source/offacc/offacc \
 	$(if $(DISABLE_GUI),,desktop/source/splash/spl) \
 	extensions/source/abpilot/abp \
-	extensions/source/config/ldap/ldapbe2 \
+	$(if $(ENABLE_NSS),extensions/source/config/ldap/ldapbe2) \
 	$(if $(filter WNT,$(OS)),\
 		extensions/source/config/WinUserInfo/WinUserInfoBe \
 	) \
diff -urN libreoffice-6.2.3.2-orig/scp2/InstallModule_ooo.mk libreoffice-6.2.3.2/scp2/InstallModule_ooo.mk
--- libreoffice-6.2.3.2-orig/scp2/InstallModule_ooo.mk	2019-04-10 19:10:51 +0900
+++ libreoffice-6.2.3.2/scp2/InstallModule_ooo.mk	2019-04-23 08:55:13 +0900
@@ -22,6 +22,7 @@
 
 $(eval $(call gb_InstallModule_define_if_set,scp2/ooo,\
 	ENABLE_MACOSX_SANDBOX \
+	ENABLE_NSS \
 	ENABLE_ONLINE_UPDATE \
 	SYSTEM_CURL \
 	SYSTEM_HSQLDB \
diff -urN libreoffice-6.2.3.2-orig/scp2/source/ooo/file_ooo.scp libreoffice-6.2.3.2/scp2/source/ooo/file_ooo.scp
--- libreoffice-6.2.3.2-orig/scp2/source/ooo/file_ooo.scp	2019-04-10 19:10:51 +0900
+++ libreoffice-6.2.3.2/scp2/source/ooo/file_ooo.scp	2019-04-23 08:55:13 +0900
@@ -173,7 +173,9 @@
 UI_FILELIST(uui, "UIConfig/uui.filelist")
 UI_FILELIST(vcl, "UIConfig/vcl.filelist")
 UI_FILELIST(writerperfect, "UIConfig/writerperfect.filelist")
+#ifdef ENABLE_NSS
 UI_FILELIST(xmlsec, "UIConfig/xmlsec.filelist")
+#endif
 
 MO_FILELIST_ALL_LANG(acc)
 MO_FILELIST_ALL_LANG(avmedia)
