SDKs
...
Tutorials
Advanced Usage

Extended Configuration

18min

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.

Accessing Current Configuration

The current configuration can be retrieved by calling currentConfig() on a LicenseManager instance in the C++ SDK:

C++
Python


It is also possible to reconfigure the current configuration, rather than having to create a new Configuration object with:

C++
Python


Warning: reconfigure() is not thread safe.

Network Information and Timeout

To activate the gathering of network information, you need to declare it during the configuration phase of the implementation, as follows:

C++
C#
Swift


Note: Network data collection is deactivated by default when left unset.

Whether network collection is enabled can be checked after configuration with:

C++
C#
Swift


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.

In the Python SDK, network information is managed within the Python Hardware (Device) IDs class, which is designed to be customizable. If a user prefers not to send network information, they can override the relevant method in the class to return None. This information can be accessed using the following:

C++
C#
Python


Note: The above code snippet assumes that a Configuration object named "configuration" and ExtendedOptions object named "extendedOptions" already exist.

Override Network Information

C++ offers a method for overriding network information, setting the NetworkInfo object stored within ExtendedOptions:

C++


Network Timeout

Similarly, the network timeout of the configuration is stored in the same locations, and can be accessed with:

C++
C#
Swift


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:

C++
C#
Swift


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.

C++


Proxy Settings

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:

C++
C#


Proxy settings can be set as follows:

C++
C#
Swift


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:

C++


Native Transport Layer Security

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:

C++


Note: If set to false, Open SSL will be used.

To later check for whether native TLS is being used:

C++


Secure Sockets Layer Certificate Verification

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:

C++


There is also a checker for whether SSL certificate verification is enabled:

C++