![]() |
TSDuck v3.46-4806
MPEG Transport Stream Toolkit
|
Common arguments for TLS client and server usage. More...
#include <tsTLSArgs.h>


Public Types | |
| using | SuperClass = IPArgs |
| Explicit definition of the superclass. | |
Public Member Functions | |
| TLSArgs (const UString &description=u"server", const UString &prefix=UString(), bool tls_default=false) | |
| Constructor. | |
| virtual void | defineClientArgs (Args &args) override |
| Add some command line options for a client in an Args. | |
| virtual void | defineServerArgs (Args &args) override |
| Add command line options for a server in an Args. | |
| const UString & | description () const |
| Get the short description of the service, as specified in the constructor. | |
| bool | hasCertificate () const |
| Check if enough parameters are provided to specify a certificate, depending on the operating system. | |
| bool | isAllowed (const IPAddress &client) const |
| On the server side, check if a client address is allowed, based on sets of allowed and denied clients. | |
| bool | loadAllowedClients (Args &args, const UChar *option) |
| Load the set of allowed clients from a command line (server side). | |
| virtual bool | loadClientArgs (Args &args, const UChar *server_option=nullptr) override |
| Load arguments for a client from a command line. | |
| bool | loadDeniedClients (Args &args, const UChar *option) |
| Load the set of denied clients from a command line (server side). | |
| virtual bool | loadServerArgs (Args &args, const UChar *server_option=nullptr) override |
| Load arguments for a server from a command line. | |
| const UString & | prefix () const |
| Get the option prefix, ready to use in other option names. | |
| const UString & | withTLS () const |
| Get the help string which defines the condition of using SSL/TLS. | |
Public Attributes | |
| IPAddressSet | allowed_clients {} |
| White-list of allowed incoming clients. | |
| UString | certificate_path {} |
| TLS server certificate path. | |
| UString | certificate_store {} |
| TLS server certificate store. | |
| cn::milliseconds | connection_timeout {0} |
| Connection timeout in milliseconds (zero means none). | |
| IPAddressSet | denied_clients {} |
| Black-list of denied incoming clients. | |
| size_t | ephemeral_rsa_bits = 0 |
| TLS server ephemeral certificate RSA kiey size in bits, when not zero. | |
| bool | insecure = false |
| Do not verify TLS server's certificate. | |
| UString | key_path {} |
| TLS server private key path. | |
| cn::milliseconds | receive_timeout {0} |
| Reception timeout in milliseconds (zero means none). | |
| bool | reuse_port = true |
| Reuse-port socket option. | |
| IPSocketAddress | server_addr {} |
| Server address and port. The address is optional on server side. | |
| UString | server_name {} |
| Server host name (required in addition to server address in some cases). | |
| bool | use_tls = false |
| Use SSL/TLS. | |
Common arguments for TLS client and server usage.
Can be set by fields or using command line options.
| ts::TLSArgs::TLSArgs | ( | const UString & | description = u"server", |
| const UString & | prefix = UString(), |
||
| bool | tls_default = false |
||
| ) |
Constructor.
| [in] | description | Short description of the TLS service. Example: "control port". Use no initial cap, no final dot. |
| [in] | prefix | Optional prefix for all command line options. Example: when prefix is "foo", the option –certificate-path becomes –foo-certificate-path. |
| [in] | tls_default | If false (the default) TLS is not the default and the option –tls is defined to activate it. If true, TLS is the default and the option –no-tls is defined to deactivate it and use clear communication. |
| bool ts::TLSArgs::hasCertificate | ( | ) | const |
Check if enough parameters are provided to specify a certificate, depending on the operating system.
|
inline |
Get the help string which defines the condition of using SSL/TLS.
The actual string depends if SSL/TLS is enabled by default or not.
|
overridevirtual |
Add command line options for a server in an Args.
No options is defined for server [addr:]port because the description is probably too specific. Same for lists of allowed and denied clients.
| [in,out] | args | Command line arguments to update. |
Reimplemented from ts::IPArgs.
Reimplemented in ts::RestArgs.
|
overridevirtual |
Add some command line options for a client in an Args.
No options is defined for server addr:port because the description is probably too specific.
| [in,out] | args | Command line arguments to update. |
Reimplemented from ts::IPArgs.
Reimplemented in ts::RestArgs.
|
overridevirtual |
Load arguments for a server from a command line.
Args error indicator is set in case of incorrect arguments.
| [in,out] | args | Command line arguments. |
| [in] | server_option | Optional name of an option which defines the server port and optional address. |
Reimplemented from ts::IPArgs.
Reimplemented in ts::RestArgs.
|
overridevirtual |
Load arguments for a client from a command line.
Args error indicator is set in case of incorrect arguments.
| [in,out] | args | Command line arguments. |
| [in] | server_option | Optional name of an option which defines the server name and address. |
Reimplemented from ts::IPArgs.
Reimplemented in ts::RestArgs.
Load the set of allowed clients from a command line (server side).
| [in,out] | args | Command line arguments. |
| [in] | option | Option which defines the client addresses. |
Load the set of denied clients from a command line (server side).
| [in,out] | args | Command line arguments. |
| [in] | option | Option which defines the client addresses. |
|
inherited |
On the server side, check if a client address is allowed, based on sets of allowed and denied clients.
| [in] | client | Incoming client address. |
|
inlineinherited |
Get the short description of the service, as specified in the constructor.
The result can be used in help text in subclasses for instance.
|
inlineinherited |
Get the option prefix, ready to use in other option names.
If the prefix was set to a non-empty string without trailing dash, the returned string contains a trailing dash. Example: when prefix was set to "foo" in the constructor, the returned value is "foo-"
| UString ts::TLSArgs::certificate_store {} |
TLS server certificate store.
| UString ts::TLSArgs::certificate_path {} |
TLS server certificate path.
| UString ts::TLSArgs::key_path {} |
TLS server private key path.