Skip to contentSkip to conversation

package/php: Add parth to ca-cert

PATCH Applied Julian Vetter via buildroot 1 participant 4 messages Jan 22 – Oct 11

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/php: Add parth to ca-cert

If BR2_PACKAGE_CA_CERTIFICATES is present, add the ca-certificates.crt to the php.ini, to not get SSL errors when using PHP.

---
 package/php/php.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/php/php.mk +8 -0
index 2c91ef7b63..3c79ae4589 100644
@@ -362,6 +362,14 @@ endef
 
 PHP_POST_INSTALL_TARGET_HOOKS += PHP_INSTALL_FIXUP
 
+ifeq ($(BR2_PACKAGE_CA_CERTIFICATES),y)
+define PHP_CERTIFICATES_FIXUP
+$(SED) 's%;openssl.cafile=%openssl.cafile=/etc/ssl/certs/ca-certificates.crt%' \
+		$(TARGET_DIR)/etc/php.ini
+endef
+PHP_POST_INSTALL_TARGET_HOOKS += PHP_CERTIFICATES_FIXUP
+endif
+
 PHP_CONF_ENV += CFLAGS="$(PHP_CFLAGS)" CXXFLAGS="$(PHP_CXXFLAGS)"
 
 HOST_PHP_CONF_OPTS = \
Signature · 6 lines
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 17 lines · Julian Vetter via buildroot

If BR2_PACKAGE_CA_CERTIFICATES is present, add the ca-certificates.crt to the php.ini, to not get SSL errors when using PHP.

---
  package/php/php.mk | 8 ++++++++
  1 file changed, 8 insertions(+)
package/php/php.mk +1 -0
index 2c91ef7b63..3c79ae4589 100644
@@ -362,6 +362,14 @@ endef
 
  PHP_POST_INSTALL_TARGET_HOOKS += PHP_INSTALL_FIXUP
 
+ifeq ($(BR2_PACKAGE_CA_CERTIFICATES),y)

package/php/php.mk endef · line 375

Quoted 10 lines
package/php/php.mk +7 -0
+define PHP_CERTIFICATES_FIXUP
+$(SED) 's%;openssl.cafile=%openssl.cafile=/etc/ssl/certs/ca-certificates.crt%' \
+		$(TARGET_DIR)/etc/php.ini
+endef
+PHP_POST_INSTALL_TARGET_HOOKS += PHP_CERTIFICATES_FIXUP
+endif
+
  PHP_CONF_ENV += CFLAGS="$(PHP_CFLAGS)" CXXFLAGS="$(PHP_CXXFLAGS)"
 
  HOST_PHP_CONF_OPTS = \

Hello,
I might have forgotten to add you Bernd. I think I have just sent it to the mailinglist.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw

Gentle ping. Is this patch of interest?

Quoted 27 lines · Julian Vetter via buildroot
Quoted 24 lines · Julian Vetter via buildroot

If BR2_PACKAGE_CA_CERTIFICATES is present, add the ca-certificates.crt to the php.ini, to not get SSL errors when using PHP.

---
  package/php/php.mk | 8 ++++++++

  1 file changed, 8 insertions(+)
package/php/php.mk +0 -0
index 2c91ef7b63..3c79ae4589 100644
@@ -362,6 +362,14 @@ endef

  PHP_POST_INSTALL_TARGET_HOOKS += PHP_INSTALL_FIXUP

package/php/php.mk +3 -0
+ifeq ($(BR2_PACKAGE_CA_CERTIFICATES),y)
+define PHP_CERTIFICATES_FIXUP
+$(SED) 's%;openssl.cafile=%openssl.cafile=/etc/ssl/certs/ca- 

certificates.crt%' \
+        $(TARGET_DIR)/etc/php.ini

package/php/php.mk +4 -0
+endef
+PHP_POST_INSTALL_TARGET_HOOKS += PHP_CERTIFICATES_FIXUP
+endif
+

  PHP_CONF_ENV += CFLAGS="$(PHP_CFLAGS)" CXXFLAGS="$(PHP_CXXFLAGS)"

Quoted 8 lines
Quoted 1 line

  HOST_PHP_CONF_OPTS = \

Hello,
I might have forgotten to add you Bernd. I think I have just sent it to the mailinglist.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw
In reply to Julian Vetter via buildroot
Quoted 4 lines · Julian Vetter via buildroot

If BR2_PACKAGE_CA_CERTIFICATES is present, add the ca-certificates.crt to the php.ini, to not get SSL errors when using PHP.

Applied to master, thanks!

Could you perhaps also extend support/testing/tests/package/test_php.py with a
test case that catches this? I'm not sure how, but perhaps there's a log message that you can search for to show that a valid CA certificate file has been loaded.

Quoted 9 lines
---
 package/php/php.mk | 8 ++++++++
 1 file changed, 8 insertions(+)
package/php/php.mk +0 -0
index 2c91ef7b63..3c79ae4589 100644

package/php/php.mk endef · line 367

Quoted 6 lines
package/php/php.mk +3 -0
@@ -362,6 +362,14 @@ endef
 
 PHP_POST_INSTALL_TARGET_HOOKS += PHP_INSTALL_FIXUP
 
+ifeq ($(BR2_PACKAGE_CA_CERTIFICATES),y)
+define PHP_CERTIFICATES_FIXUP
+$(SED) 's%;openssl.cafile=%openssl.cafile=/etc/ssl/certs/ca-certificates.crt%' \

Wrong indentation here, should be indented with a tab (caught by check-package).

Regards,
Arnout

Quoted 10 lines
package/php/php.mk +5 -0
+		$(TARGET_DIR)/etc/php.ini
+endef
+PHP_POST_INSTALL_TARGET_HOOKS += PHP_CERTIFICATES_FIXUP
+endif
+
 PHP_CONF_ENV += CFLAGS="$(PHP_CFLAGS)" CXXFLAGS="$(PHP_CXXFLAGS)"
 
 HOST_PHP_CONF_OPTS = \
Signature · 1 line
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot