@@ -224,9 +224,7 @@ extension _EasyHandle {
224
224
// When no certificate file has been specified, assemble all the certificate files
225
225
// from the Android certificate store and writes them to a single `cacerts.pem` file
226
226
//
227
- // See https://android.googlesource.com/platform/frameworks/base/+/8b192b19f264a8829eac2cfaf0b73f6fc188d933%5E%21/#F0
228
-
229
- // See https://github.com/apple/swift-nio-ssl/blob/d1088ebe0789d9eea231b40741831f37ab654b61/Sources/NIOSSL/AndroidCABundle.swift#L30
227
+ // See https://github.com/apple/swift-nio-ssl/blob/main/Sources/NIOSSL/AndroidCABundle.swift
230
228
let certsFolders = [
231
229
" /apex/com.android.conscrypt/cacerts " , // >= Android14
232
230
" /system/etc/security/cacerts " // < Android14
@@ -251,7 +249,7 @@ extension _EasyHandle {
251
249
""" . data ( using: . utf8) !)
252
250
253
251
// Go through each folder and load each certificate file (ending with ".0"),
254
- // and append them together into a single aggreagate file tha curl can load.
252
+ // and append them together into a single aggreagate file that curl can load.
255
253
// The .0 files will contain some extra metadata, but libcurl only cares about the
256
254
// -----BEGIN CERTIFICATE----- and -----END CERTIFICATE----- sections,
257
255
// so we can naïvely concatenate them all and libcurl will understand the bundle.
@@ -268,7 +266,6 @@ extension _EasyHandle {
268
266
try fs. write ( contentsOf: try Data ( contentsOf: certURL) )
269
267
} catch {
270
268
// ignore individual errors and soldier on…
271
- //logger.warning("bootstrapSSLCertificates: error reading certificate file \(certURL.path): \(error)")
272
269
continue
273
270
}
274
271
}
@@ -277,6 +274,7 @@ extension _EasyHandle {
277
274
try ! fs. close ( )
278
275
279
276
aggregateCertPath. withCString { pathPtr in
277
+ // note that it would be nice to use CFURLSessionOptionCAPATH instead (https://curl.se/libcurl/c/CURLOPT_CAPATH.html), but it requires a special command to hash the directory contents, which we cannot
280
278
try ! CFURLSession_easy_setopt_ptr ( rawHandle, CFURLSessionOptionCAINFO, UnsafeMutablePointer ( mutating: pathPtr) ) . asError ( )
281
279
}
282
280
return
0 commit comments