- Documentation
- Reference manual
- Packages
- SWI-Prolog SSL Interface
- library(ssl): Secure Socket Layer (SSL) library
- ssl_context/3
- ssl_upgrade_legacy_options/2
- ssl_add_certificate_key/4
- ssl_set_options/3
- ssl_property/2
- ssl_negotiate/5
- ssl_peer_certificate/2
- ssl_peer_certificate_chain/2
- ssl_session/2
- load_certificate/2
- write_certificate/3
- load_crl/2
- system_root_certificates/1
- load_private_key/3
- load_public_key/2
- cert_accept_any/5
- same_certificate/2
- verify_certificate_issuer/2
- verify_certificate/3
- certificate_field/2
- ssl_secure_ciphers/1
- library(ssl): Secure Socket Layer (SSL) library
- SWI-Prolog SSL Interface
[det]system_root_certificates(-List)system(root_certificates). The list is obtained using an OS
specific process. The current implementation is as follows:
- On Windows, CertOpenSystemStore() is used to import the
"ROOT"certificates from the OS. - On Unix and macOS, certificates are loaded from a file defined by
the Prolog flag system_cacert_filename. The initial value of this
flag is established at build time and is
/etc/ssl/cert.pemon macOS. For security reasons, the flag can only be set prior to using the SSL library. For example::- use_module(library(ssl)). :- set_prolog_flag(system_cacert_filename, '/home/jan/ssl/ca-bundle.crt'). - On macOS the flag may be set to
keychain, in which case the trust anchors are obtained from the keychain using SecTrustCopyAnchorCertificates(). This is also used as fallback if the file above does not exist or holds no certificates. It is not the default because this API talks to thesecurityddaemon over Mach IPC, which can block indefinitely if the keychain is not accessible, e.g., in an ssh session while the login keychain is locked. Such a block cannot be interrupted using e.g. call_with_time_limit/2.
Note that a PEM file is a plain list of certificates. Unlike the keychain it cannot express trust settings made by the user or the administrator, e.g., root certificates that have been distrusted.
If no certificates can be obtained at all a warning is printed and
List is unified with [], which makes all
certificate verification fail.