How does Certificate[store]="mozilla" work?
- User
How does Certificate[store]="mozilla" work?
- Assistant
When
Certificate[store]is set to"mozilla"in the configuration, the behavior of the certificate store is as follows:-
Purpose:
The"mozilla"value for thestorefield defines the use of a pre-defined set of trusted CA certificates derived from the Mozilla Included List. This list excludes certificates issued by China CA authorities, as per the documentation. -
Implementation Details:
- The
storevalue is passed via theCertificateOptionsstructure (type CertificateOptionsin./repos/sing-box/option/certificate.go). - The
"mozilla"store type is represented by the constantCertificateStoreMozilladefined in./repos/sing-box/constant/certificate.go.
- The
-
Code Execution:
- In the
NewStorefunction in./repos/sing-box/common/certificate/store.go, the code initializes the certificate store based on thestorevalue. - When
options.Storeequals"mozilla", thesystemPoolis set to a pre-defined variable namedmozillaIncluded:gocase C.CertificateStoreMozilla: systemPool = mozillaIncluded - The
mozillaIncludedvariable is not defined in the provided context, but it is assumed to be a pre-loaded*x509.CertPoolcontaining the Mozilla CA certificates minus the China-specific certificates.
- In the
-
Behavior:
- The system does not rely on the operating system's trusted CA certificates (default for
"system"). - Instead, it uses the custom CA list (
mozillaIncluded). - Additional certificates specified via the
certificate,certificate_path, orcertificate_directory_pathfields in the configuration can be appended to this pool.
- The system does not rely on the operating system's trusted CA certificates (default for
-
Dynamic Reload:
- The certificates from
certificate_pathandcertificate_directory_pathare monitored for changes and dynamically reloaded using a file system watcher ().
- The certificates from
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.