- swipl
- library
- error.pl -- Error generating support
- apply.pl -- Apply predicates on a list
- lists.pl -- List Manipulation
- debug.pl -- Print debug messages and test assertions
- broadcast.pl -- Event service
- socket.pl -- Network socket (TCP and UDP) library
- predicate_options.pl -- Access and analyse predicate options
- shlib.pl -- Utility library for loading foreign objects (DLLs, shared objects)
- option.pl -- Option list processing
- uid.pl -- User and group management on Unix systems
- unix.pl -- Unix specific operations
- syslog.pl -- Unix syslog interface
- thread_pool.pl -- Resource bounded thread management
- gensym.pl -- Generate unique symbols
- settings.pl -- Setting management
- arithmetic.pl -- Extensible arithmetic
- main.pl -- Provide entry point for scripts
- readutil.pl -- Read utilities
- ssl.pl -- 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
- crypto.pl -- Cryptography and authentication library
- filesex.pl -- Extended operations on files
- doc_http.pl -- Documentation server
- pldoc.pl -- Process source documentation
- operators.pl -- Manage operators
- pairs.pl -- Operations on key-value lists
- prolog_source.pl -- Examine Prolog source-files
- sgml.pl -- SGML, XML and HTML parser
- quasi_quotations.pl -- Define Quasi Quotation syntax
- uri.pl -- Process URIs
- url.pl -- Analysing and constructing URL
- www_browser.pl -- Open a URL in the users browser
- prolog_colour.pl -- Prolog syntax colouring support.
- record.pl -- Access compound arguments by name
- prolog_xref.pl -- Prolog cross-referencer data collection
- occurs.pl -- Finding and counting sub-terms
- ordsets.pl -- Ordered set manipulation
- assoc.pl -- Binary associations
- ugraphs.pl -- Graph manipulation library
- xpath.pl -- Select nodes in an XML DOM
- iostream.pl -- Utilities to deal with streams
- atom.pl -- Operations on atoms
- porter_stem.pl
- solution_sequences.pl -- Modify solution sequences
- prolog_pack.pl -- A package manager for Prolog
- process.pl -- Create processes and redirect I/O
- memfile.pl
- prolog_config.pl -- Provide configuration information
- git.pl -- Run GIT commands
- ctypes.pl -- Character code classification
- time.pl -- Time and alarm library
- utf8.pl -- UTF-8 encoding/decoding on lists of character codes.
- base64.pl -- Base64 encoding and decoding
- sha.pl -- SHA secure hashes
- crypt.pl
- persistency.pl -- Provide persistent dynamic predicates
- pure_input.pl -- Pure Input from files and streams
- nb_set.pl -- Non-backtrackable sets
- xsdp_types.pl -- XML-Schema primitive types
- uuid.pl -- Universally Unique Identifier (UUID) Library
- pcre.pl -- Perl compatible regular expression matching for SWI-Prolog
- aggregate.pl -- Aggregation operators on backtrackable predicates
- rdf_write.pl -- Write RDF/XML from a list of triples
- rdf.pl -- RDF/XML parser
- sgml_write.pl -- XML/SGML writer module
- archive.pl -- Access several archive formats
- csv.pl -- Process CSV (Comma-Separated Values) data
- dialect.pl -- Support multiple Prolog dialects
- apply_macros.pl -- Goal expansion rules to avoid meta-calling
- pengines.pl -- Pengines: Web Logic Programming Made Easy
- random.pl -- Random numbers
- zlib.pl -- Zlib wrapper for SWI-Prolog
- bdb.pl -- Berkeley DB interface
- hash_stream.pl -- Maintain a hash on a stream
- md5.pl -- MD5 hashes
- sandbox.pl -- Sandboxed Prolog code
- prolog_format.pl -- Analyse format specifications
- pprint.pl -- Pretty Print Prolog terms
- lazy_lists.pl -- Lazy list handling
- pengines_io.pl -- Provide Prolog I/O for HTML clients
- yall.pl -- Lambda expressions
- edinburgh.pl -- Some traditional Edinburgh predicates
- prolog_clause.pl -- Get detailed source-information about a clause
- prolog_breakpoints.pl -- Manage Prolog break-points
- dicts.pl -- Dict utilities
- dif.pl -- The dif/2 constraint
- thread.pl -- High level thread primitives
- rbtrees.pl -- Red black trees
- nb_rbtrees.pl -- Non-backtrackable operations on red black trees
- mallocinfo.pl -- Memory allocation details
- date.pl -- Process dates and times
- snowball.pl -- The Snowball multi-lingual stemmer library
- rdf_triple.pl -- Create triples from intermediate representation
- rdf_parser.pl
- rewrite_term.pl
- oset.pl -- Ordered set manipulation
- modules.pl -- Module utility predicates
- tables.pl -- XSB interface to tables
- base32.pl -- Base32 encoding and decoding
- charsio.pl -- I/O on Lists of Character Codes
- codesio.pl -- I/O on Lists of Character Codes
- coinduction.pl -- Co-Logic Programming
- heaps.pl -- heaps/priority queues
- sort.pl
- statistics.pl -- Get information about resource usage
- terms.pl -- Term manipulation
- varnumbers.pl -- Utilities for numbered terms
- when.pl -- Conditional coroutining
- backcomp.pl -- Backward compatibility
- edit.pl -- Editor interface
- doc_latex.pl -- PlDoc LaTeX backend
- listing.pl -- List programs and pretty print clauses
- system.pl -- System utilities
- make.pl -- Reload modified source files
- intercept.pl -- Intercept and signal interface
- files.pl
- doc_files.pl -- Create stand-alone documentation files
- hashtable.pl -- Hash tables
- shell.pl -- Elementary shell commands
- quintus.pl -- Quintus compatibility
- prolog_codewalk.pl -- Prolog code walker
- prolog_metainference.pl -- Infer meta-predicate properties
- prolog_code.pl -- Utilities for reasoning about code
- check.pl -- Consistency checking
- prolog_stack.pl -- Examine the Prolog stack
- optparse.pl -- command line parsing
- strings.pl -- String utilities
- yaml.pl -- Process YAML data
- help.pl -- Text based manual
- isub.pl -- isub: a string similarity measure
- threadutil.pl -- Interactive thread utilities
- redis_streams.pl -- Using Redis streams
- redis.pl -- Redis client
- odbc.pl
- editline.pl -- BSD libedit based command line editing
- wfs.pl -- Well Founded Semantics interface
- pwp.pl -- Prolog Well-formed Pages
- prolog_autoload.pl -- Autoload all dependencies
- ansi_term.pl -- Print decorated text to ANSI consoles
- prolog_trace.pl -- Print access to predicates
- writef.pl -- Old-style formatted write
- prolog_wrap.pl -- Wrapping predicates
- paxos.pl -- A Replicated Data Store
- table.pl
- readline.pl -- GNU readline interface
- plunit.pl -- Unit Testing
- test_cover.pl -- Clause cover analysis
- explain.pl -- Describe Prolog Terms
- term_to_json.pl
- unicode.pl -- Unicode string handling
- xmlenc.pl -- XML encryption library
- cgi.pl -- Read CGI parameters
- prolog_jiti.pl -- Just In Time Indexing (JITI) utilities
- udp_broadcast.pl -- A UDP broadcast proxy
- qsave.pl -- Save current program as a state or executable
- zip.pl -- Access resource ZIP archives
- prolog_stream.pl -- A stream with Prolog callbacks
- c14n2.pl -- C14n2 canonical XML documents
- protobufs.pl -- Google's Protocol Buffers
- double_metaphone.pl -- Phonetic string matching
- prolog_history.pl -- Per-directory persistent commandline history
- xmldsig.pl -- XML Digital signature
- tty.pl -- Terminal operations
- streampool.pl -- Input multiplexing
- rlimit.pl
- library
- ssl_context(+Role, -SSL, :Options) is det
- Create an SSL context. The context defines several properties
of the SSL connection such as involved keys, preferred
encryption, and passwords. After establishing a context, an SSL
connection can be negotiated using ssl_negotiate/5, turning two
arbitrary plain Prolog streams into encrypted streams. This
predicate processes the options below.
- host(+HostName)
- For the client, the host to which it connects. This option
should be specified when Role is
client
. Otherwise, certificate verification may fail when negotiating a secure connection. - certificate_file(+FileName)
- Specify where the certificate file can be found. This can be the
same as the
key_file(+FileName)
option. A server must have at least one certificate before clients can connect. A client must have a certificate only if the server demands the client to identify itself with a client certificate using thepeer_cert(true)
option. If a certificate is provided, it is necessary to also provide a matching private key via the key_file/1 option. To configure multiple certificates, use the option certificate_key_pairs/1 instead. Alternatively, use ssl_add_certificate_key/4 to add certificates and keys to an existing context. - key_file(+FileName)
- Specify where the private key that matches the certificate can
be found. If the key is encrypted with a password, this must
be supplied using the
password(+Text)
orpem_password_hook(:Goal)
option. - certificate_key_pairs(+Pairs)
- Alternative method for specifying certificates and keys. The argument is a list of pairs of the form Certificate-Key, where each component is a string or an atom that holds, respectively, the PEM-encoded certificate and key. To each certificate, further certificates of the chain can be appended. Multiple types of certificates can be present at the same time to enable different ciphers. Using multiple certificate types with completely independent certificate chains requires OpenSSL 1.0.2 or greater.
- password(+Text)
- Specify the password the private key is protected with (if any). If you do not want to store the password you can also specify an application defined handler to return the password (see next option). Text is either an atom or string. Using a string is preferred as strings are volatile and local resources.
- pem_password_hook(:Goal)
- In case a password is required to access the private key the
supplied predicate will be called to fetch it. The hook is
called as
call(Goal, +SSL, -Password)
and typically unifies Password with a string containing the password. - require_crl(+Boolean)
- If true (default is false), then all certificates will be
considered invalid unless they can be verified as not being
revoked. You can do this explicity by passing a list of CRL
filenames via the crl/1 option, or by doing it yourself in
the cert_verify_hook. If you specify
require_crl(true)
and provide neither of these options, verification will necessarily fail - crl(+ListOfFileNames)
- Provide a list of filenames of PEM-encoded CRLs that will be
given to the context to attempt to establish that a chain of
certificates is not revoked. You must also set
require_crl(true)
if you want CRLs to actually be checked by OpenSSL. - cacert_file(+FileName)
- Deprecated. Use cacerts/1 instead.
Specify a file containing certificate keys of trusted
certificates. The peer is trusted if its certificate is
signed (ultimately) by one of the provided certificates. Using
the FileName
system(root_certificates)
uses a list of trusted root certificates as provided by the OS. See system_root_certificates/1 for details. - cacerts(+ListOfCATerms)
- Specify a list of sources of trusted certificates.
Each element in the list should be one of the following:
file(Filename)
: A file containing one or more PEM-encoded certificatescertificate(Blob)
: A certificate blobsystem(root_certificates)
: A special term which refers to the certificates trusted by the host OS.
Additional verification of the peer certificate as well as accepting certificates that are not trusted by the given set can be realised using the hook cert_verify_hook(:Goal).
- cert_verify_hook(:Goal)
- The predicate ssl_negotiate/5 calls Goal as follows:
call(Goal, +SSL, +ProblemCertificate, +AllCertificates, +FirstCertificate, +Error)
In case the certificate was verified by one of the provided certifications from the
cacert_file
option, Error is unified with the atomverified
. Otherwise it contains the error string passed from OpenSSL. Access will be granted iff the predicate succeeds. See load_certificate/2 for a description of the certificate terms. See cert_accept_any/5 for a dummy implementation that accepts any certificate. - cipher_list(+Atom)
- Specify a cipher preference list (one or more cipher strings separated by colons, commas or spaces). See ssl_secure_ciphers/1.
- ecdh_curve(+Atom)
- Specify a curve for ECDHE ciphers. If this option is not
specified, the OpenSSL default parameters are used. With
OpenSSL prior to 1.1.0,
prime256v1
is used by default. - peer_cert(+Boolean)
- Trigger the request of our peer's certificate while establishing the SSL layer. This option is automatically turned on in a client SSL socket. It can be used in a server to ask the client to identify itself using an SSL certificate.
- close_parent(+Boolean)
- If
true
, close the raw streams if the SSL streams are closed. Default isfalse
. - close_notify(+Boolean)
- If
true
(default isfalse
), the server sends TLSclose_notify
when closing the connection. In addition, this mitigates truncation attacks for both client and server role: If EOF is encountered without having received a TLS shutdown, an exception is raised. Well-designed protocols are self-terminating, and this attack is therefore very rarely a concern. - min_protocol_version(+Atom)
- Set the minimum protocol version that can be negotiated.
Atom is one of
sslv3
,tlsv1
,tlsv1_1
,tlsv1_2
andtlsv1_3
. This option is available with OpenSSL 1.1.0 and later, and should be used instead of disable_ssl_methods/1. - max_protocol_version(+Atom)
- Set the maximum protocol version that can be negotiated.
Atom is one of
sslv3
,tlsv1
,tlsv1_1
,tlsv1_2
andtlsv1_3
. This option is available with OpenSSL 1.1.0 and later, and should be used instead of disable_ssl_methods/1. - disable_ssl_methods(+List)
- A list of methods to disable. Unsupported methods will be
ignored. Methods include
sslv2
,sslv3
,sslv23
,tlsv1
,tlsv1_1
andtlsv1_2
. This option is deprecated starting with OpenSSL 1.1.0. Use min_protocol_version/1 and max_protocol_version/1 instead. - ssl_method(+Method)
- Specify the explicit Method to use when negotiating. For
allowed values, see the list for
disable_ssl_methods
above. Using this option is discouraged. When using OpenSSL 1.1.0 or later, this option is ignored, and a version-flexible method is used to negotiate the connection. Using version-specific methods is deprecated in recent OpenSSL versions, and this option will become obsolete and ignored in the future. - sni_hook(:Goal)
- This option provides Server Name Indication (SNI) for SSL
servers. This means that depending on the host to which a
client connects, different options (certificates etc.) can
be used for the server. This TLS extension allows you to host
different domains using the same IP address and physical
machine. When a TLS connection is negotiated with a client
that has provided a host name via SNI, the hook is called as
follows:
call(Goal, +SSL0, +HostName, -SSL)
Given the current context SSL0, and the host name of the client request, the predicate computes SSL which is used as the context for negotiating the connection. The first solution is used. If the predicate fails, the default options are used, which are those of the encompassing ssl_context/3 call. In that case, if no default certificate and key are specified, the client connection is rejected.
- alpn_protocols(+ListOfProtoIdentifiers)
- Provide a list of acceptable ALPN protocol identifiers as atoms. ALPN support requires OpenSSL 1.0.2 or greater.
- alpn_protocol_hook(:Goal)
- This options provides a callback for a server context to use to
select an ALPN protocol. It will be called as follows:
===
call(Goal, +SSLCtx0, +ListOfClientProtocols, -SSLCtx1, -SelectedProtocol)
===If this option is unset and the alpn_protocols/1 option is set, then the first common protocol between client & server will be selected.
- Arguments:
-
Role - is one of server
orclient
and denotes whether the SSL instance will have a server or client role in the established connection.SSL - is a SWI-Prolog blob of type ssl_context
, i.e., the type-test for an SSL context isblob(SSL, ssl_context)
.