Attempt to discover a set of trusted certificate authority certificates (or, in other words: trust roots, or root certificates) whose trust is managed and updated by tools outside of Twisted.
If you are writing any client-side TLS code with Twisted, you should use
this as the
trustRoot argument to
The result of this function should be like the up-to-date list of
certificates in a web browser. When developing code that uses
platformTrust, you can think of it that way. However, the
choice of which certificate authorities to trust is never Twisted's
responsibility. Unless you're writing a very unusual application or
library, it's not your code's responsibility either. The user may use
platform-specific tools for defining which server certificates should be
trusted by programs using TLS. The purpose of using this API is to respect
that decision as much as possible.
This should be a set of trust settings most appropriate for client TLS connections; i.e. those which need to verify a server's authenticity. You should probably use this by default for any client TLS connection that you create. For servers, however, client certificates are typically not verified; or, if they are, their verification will depend on a custom, application-specific certificate authority.
|Returns||an appropriate trust settings object for your platform. (type: |
|Raises||NotImplementedError||if this platform is not yet supported by Twisted. At present, only OpenSSL is supported.|
Nevertheless, this ought to work as desired by default on:
Hopefully soon, this API will be updated to use more sophisticated trust-root discovery mechanisms. Until then, you can follow tickets in the Twisted tracker for progress on this implementation on Microsoft Windows, macOS, and a fallback for other platforms which do not have native trust management tools.