[TLS] Add support for platform-specific CA bundles.

Adds a new OS::get_system_ca_certs method which can be implemented by
platforms to retrieve the list of trusted CA certificates using OS
specific APIs.

The function should return the certificates in PEM format, and is
currently implemented for Windows/macOS/LinuxBSD(*)/Android.

mbedTLS will fall back to bundled certificates when the OS returns no
certificates.

(*) LinuxBSD does not have a standardized certificates store location.
    The current implementation will test for common locations and may
    return an empty string on some distributions (falling back to the
    bundled certificates).
This commit is contained in:
Fabio Alessandrelli 2023-04-13 21:17:55 +02:00
parent 4e1d5be9d3
commit 6fd9982358
17 changed files with 180 additions and 13 deletions

View file

@ -133,6 +133,8 @@ public:
virtual Error move_to_trash(const String &p_path) override;
virtual String get_system_ca_certificates() override;
OS_LinuxBSD();
~OS_LinuxBSD();
};