Skip to contentSkip to conversation

package/libcurl: Also specify the CA bundle location

PATCH Applied Lance Fredrickson 3 participants 5 messages Apr 17, 2025 – Feb 4

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/libcurl: Also specify the CA bundle location

From: Lance Fredrickson <[email protected]>

---
 package/libcurl/libcurl.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/libcurl/libcurl.mk +2 -1
index 2066ba0388..509feeab64 100644
@@ -67,7 +67,8 @@ endif
 ifeq ($(BR2_PACKAGE_LIBCURL_OPENSSL),y)
 LIBCURL_DEPENDENCIES += openssl
 LIBCURL_CONF_OPTS += --with-openssl=$(STAGING_DIR)/usr \
-	--with-ca-path=/etc/ssl/certs
+	--with-ca-path=/etc/ssl/certs \
+	--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt
 else
 LIBCURL_CONF_OPTS += --without-openssl
 endif
Signature · 6 lines
2.39.5

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

This is a patch I've carried for my project where I only keep the ca bundle. The ca-certificates package does install the bundle and distros like debian do specify a ca path & a ca bundle when configuring.

https://salsa.debian.org/debian/curl/-/blob/debian/unstable/debian/rules?ref_type=heads#L20

Lance

Quoted 12 lines · Lance Fredrickson

From: Lance Fredrickson <[email protected]>

---
  package/libcurl/libcurl.mk | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
package/libcurl/libcurl.mk +0 -0
index 2066ba0388..509feeab64 100644

package/libcurl/libcurl.mk endif · line 74

Quoted 9 lines
package/libcurl/libcurl.mk +2 -1
@@ -67,7 +67,8 @@ endif
  ifeq ($(BR2_PACKAGE_LIBCURL_OPENSSL),y)
  LIBCURL_DEPENDENCIES += openssl
  LIBCURL_CONF_OPTS += --with-openssl=$(STAGING_DIR)/usr \
-	--with-ca-path=/etc/ssl/certs
+	--with-ca-path=/etc/ssl/certs \
+	--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt
  else
  LIBCURL_CONF_OPTS += --without-openssl
  endif

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

#2 lore raw
In reply to Lance Fredrickson
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Lance" == Lance Fredrickson <[email protected]> writes:

From: Lance Fredrickson <[email protected]>

Why? What does that change?

Quoted 26 lines
---
 package/libcurl/libcurl.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/libcurl/libcurl.mk +2 -1
index 2066ba0388..509feeab64 100644
@@ -67,7 +67,8 @@ endif
 ifeq ($(BR2_PACKAGE_LIBCURL_OPENSSL),y)
 LIBCURL_DEPENDENCIES += openssl
 LIBCURL_CONF_OPTS += --with-openssl=$(STAGING_DIR)/usr \
-	--with-ca-path=/etc/ssl/certs
+	--with-ca-path=/etc/ssl/certs \
+	--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt
 else
 LIBCURL_CONF_OPTS += --without-openssl
 endif
Signature · 6 lines
2.39.5

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

I somehow missed this email.

Quoted 5 lines · Peter Korsgaard
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Lance" == Lance Fredrickson <[email protected]> writes:

From: Lance Fredrickson <[email protected]>

Why? What does that change?

This just adds the ability to also verify against ca-certificates.crt. I remove all other certs and just keep this one. Debian defines it as well. https://salsa.debian.org/debian/curl/-/blob/debian/unstable/debian/rules?ref_type=heads#L20

And the cert bundle is also installed.

        # Install the certificates bundle
        $(INSTALL) -D -m 644 $(BUILD_DIR)/ca-certificates.crt \
                $(TARGET_DIR)/etc/ssl/certs/ca-certificates.crt

Quoted 21 lines
Quoted 20 lines
---
 package/libcurl/libcurl.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
package/libcurl/libcurl.mk +2 -2
index 2066ba0388..509feeab64 100644
@@ -67,7 +67,8 @@ endif
 ifeq ($(BR2_PACKAGE_LIBCURL_OPENSSL),y)
 LIBCURL_DEPENDENCIES += openssl
 LIBCURL_CONF_OPTS += --with-openssl=$(STAGING_DIR)/usr \
-	--with-ca-path=/etc/ssl/certs
+	--with-ca-path=/etc/ssl/certs \
+	--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt
 else
 LIBCURL_CONF_OPTS += --without-openssl
 endif
--
Quoted 8 lines
Quoted 6 lines

2.39.5

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

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

#4 lore raw
In reply to Lance Fredrickson

Hi Lance,

Quoted 3 lines · Lance Fredrickson

From: Lance Fredrickson <[email protected]>

Applied to master, thanks. I extended the commit message quite a bit.

package/libcurl: also specify the CA bundle location

When given a certificate directory with --with-ca-path, curl doesn't list the files in that directory. Instead, it uses the certificate hash to directly open the requested CA certificate. Therefore, putting a bundle in that directory and removing all the individual certificates is not possible.

In order to support use of the bundle, a separate configuration option --with-ca-bundle is needed. With this option, it is possible to remove the individual certificates and include just the bundle, which reduces the size of the root filesystem a bit.

Note that the bundle is generated by the ca-certificates package, which also installs the individual certificates and the hash symlinks. It keeps both individual certificates and the bundle in the target.

Regards,
Arnout

Quoted 9 lines
---
  package/libcurl/libcurl.mk | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
package/libcurl/libcurl.mk +0 -0
index 2066ba0388..509feeab64 100644

package/libcurl/libcurl.mk endif · line 74

Quoted 9 lines
package/libcurl/libcurl.mk +2 -1
@@ -67,7 +67,8 @@ endif
  ifeq ($(BR2_PACKAGE_LIBCURL_OPENSSL),y)
  LIBCURL_DEPENDENCIES += openssl
  LIBCURL_CONF_OPTS += --with-openssl=$(STAGING_DIR)/usr \
-	--with-ca-path=/etc/ssl/certs
+	--with-ca-path=/etc/ssl/certs \
+	--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt
  else
  LIBCURL_CONF_OPTS += --without-openssl
  endif

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