Extended Configuration
LicenseSpring offers many features to tailor the setup to meet user needs through the Configuration and ExtendedOptions classes. Throughout this tutorial, we'll provide a comprehensive overview of these classes and how they are used to manage settings.
In addition to the theoretical understanding, this tutorial also offers practical guidance. You'll find instructions on how to set up a proxy, a crucial element in various software setups. We'll also cover the important topic of SSL checks, discussing their importance and how to integrate them effectively.
This tutorial will provide readers with a solid understanding of the Configuration and ExtendedOptions classes, acquired practical skills in configuring proxies, and obtained insights into enhancing security through SSL checks.
Swift SDK does not have separated ExtendedConfiguration: all properties are defined in the Configurationitself.
The current configuration can be retrieved by calling currentConfig() on a LicenseManager instance in the C++ SDK:
It is also possible to reconfigure the current configuration, rather than having to create a new Configuration object with:
Warning: reconfigure() is not thread safe.
To activate the gathering of network information, you need to declare it during the configuration phase of the implementation, as follows:
Note: Network data collection is deactivated by default when left unset.
Whether network collection is enabled can be checked after configuration with:
A variety of network-related information can be accessed through both ExtendedOptions and Configuration in C++ and Configuration in .NET.
In C++, a NetworkInfo object is returned when getNetworkInfo is called. The NetworkInfo object consists of the following:
- IP address
- MAC address
- Host name
In .NET, the IP address, MAC address, and host name are stored separately in Configuration.
This information can be accessed using the following:
Note: The above code snippet assumes that a Configuration object named "configuration" and ExtendedOptions object named "extendedOptions" already exist.
C++ offers a method for overriding network information, setting the NetworkInfo object stored within ExtendedOptions:
Similarly, the network timeout of the configuration is stored in the same locations, and can be accessed with:
Note: In C++, the network timeout is represented as a long, while in .NET, it is represented as an int.
Configuring the network timeout is equally straightforward, accomplished in a comparable manner:
The C++ SDK also allows to set and get the connection timeout, i.e. the value used for CURLOPT_CONNECTTIMEOUT. It defaults to 7 seconds.
Proxy settings are configuration parameters that allow you to route network traffic through an intermediary server, known as a proxy server. Proxy settings are another feature stored within ExtendedOptions and Configuration that can be accessed with:
Proxy settings can be set as follows:
Exception: AuthorizationException thrown if authorization fails. To resolve, check and ensure proxy settings are correct.
In the Windows version of the C++ SDK, proxy settings can be automatically fetched through the WinHTTP API.
If the proxy is autoconfigured through a .pac file over the network, the SDK reads which proxy is used to reach api.licensespring.com or some other custom API URL.
Proxy credentials are read from Windows Credential Manager, and the caller needs to supply the exact Windows Credential target that holds the credentials:
The C++ SDK offers the opportunity to enable or disable native TLS for curl.
Note: Schannel is the protocol used for Windows, while Secure Transport is utilized for macOS.
Before modifying the default settings of the SDK, it's crucial to have a clear understanding of the implications.
Make sure to consult the curl documentation for guidance:
To enable native TLS for curl, we use:
Note: If set to false, Open SSL will be used.
To later check for whether native TLS is being used:
Similar to native TLS, the C++ SDK allows developers to decide whether SSL certificate verification is to be enabled or disabled.
Note: By default, SSL certificate verification is enabled.
We strongly discourage disabling this option.
For more information, see the SSL Certificate Verification Documentation.
To disable SSL certificate verification:
There is also a checker for whether SSL certificate verification is enabled: