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 configuration itself accessing current configuration the current configuration can be retrieved by calling currentconfig() on a licensemanager instance in the c++ sdk configuration = licensemanager >currentconfig();manager = licensemanager(conf) config = manager current config() print(config) java licensespringconfiguration config = licensemanager getconfig(); it is also possible to reconfigure the current configuration, rather than having to create a new configuration object with reconfigure( configuration );manager = licensemanager(conf) manager reconfigure( configuration( product="lkprod2", api key="new key", shared key="new key", file key="file key", file iv="file iv", file path="bb", grace period conf=12, is guard file enabled=true, ) ) java licensemanager reinitialize(configuration); 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 extendedoptions collectnetworkinfo( true );extendedoptions collectnetworkinfo = true; //or configuration collectnetworkinfo = true;configuration collecthostnameandlocalip = true java configuration storemachineinfo = true; note network data collection is deactivated by default when left unset whether network collection is enabled can be checked after configuration with bool enabled = extendedoptions iscollectnetworkinfoenabled(); //or bool enabled = configuration >iscollectnetworkinfoenabled();bool enabled = extendedoptions collectnetworkinfo; //or bool enabled = configuration collectnetworkinfo;configuration collecthostnameandlocalip java boolean enabled = baseconfiguration isstoremachineinfo(); 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 docid\ ordujmleqe 0sssxxa3bq 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 //through extendedoptions const networkinfo& networkinfo = extendedoptions getnetworkinfo(); //through configuration const networkinfo& networkinfo = configuration >getnetworkinfo(); string ipaddress = networkinfo ip(); string macaddress = networkinfo mac(); string hostname = networkinfo hostname();string hostname = configuration hostname; string ip = configuration localip; string macaddress = configuration macaddress;# this will overwrite hardwareidprovided and disable sending network data and os data \# this approach allows you to disable fields which fit user needs or set them to some default value class customhardwareidprovider(hardwareidprovider) def get os ver(self) return none def get hostname(self) return none def get ip(self) return none def get is vm(self) return false def get vm info(self) return none def get mac address(self) return none java machineinfo machineinfo = hardwareinfo getmachineinfo(); string macaddress = machineinfo getmacaddress(); string ipaddresses = machineinfo getipaddresses(); string hostname = machineinfo gethostname(); 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 extendedoptions overridenetworkinfo( networkinfo ); network timeout similarly, the network timeout of the configuration is stored in the same locations, and can be accessed with long timeout = extendedoptions getnetworktimeout(); //or long timeout = configuration >getnetworktimeout();int timeout = extendedoptions networktimeout; //or int timeout = configuration networktimeout;configuration networktimeout java // request timeout in seconds, default is 10s long requesttimeout = configuration getrequesttimeout(); 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 extendedoptions setnetworktimeout( timeout ); //or configuration >setnetworktimeout( timeout );extendedoptions networktimeout = timeout; //or configuration networktimeout = timeout;configuration networktimeout = timeout // timeinterval java licensespringconfiguration config = licensespringconfiguration requesttimeout(15) // setting timeout to 15s builder() 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 extendedoptions setconnecttimeout( timeout ); //or configuration >setconnecttimeout( timeout ); 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 proxysettings proxy = extendedoptions getproxysettings(); //or proxysettings proxy = configuration >getproxysettings();proxysettings proxy = extendedoptions proxy; //or proxysettings proxy = configuration proxy; java string proxyhost = config getproxyhost(); integer proxyport = config getproxyhost(); string proxyuser = config getproxyhost(); string proxypass = config getproxyhost(); string proxycertpath = config getproxycertpath(); proxy settings can be set as follows extendedoptions setproxysettings( proxysettings );extendedoptions proxy = proxysettings; //or configuration proxy = proxysettings;configuration proxyhost = " " configuration proxyport = 65535 // uint16 java licensespringconfiguration config = licensespringconfiguration proxyhost("192 168 1 3") proxyport(3128) proxyuser("test") proxypass("test") builder() 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 licensespring proxysettings proxy; std string serviceurl = "https //api licensespring com"; std string credentialtarget = "windowsproxycredential"; //depends on the proxy setu bool throwexceptions = true; // false by default proxy fetchproxysettings(serviceurl, credentialtarget, throwexceptions); 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 ssl/tls documentation ssl/tls library comparison to enable native tls for curl, we use extendedoptions setusenativetls( true ); java licensespringconfiguration config = licensespringconfiguration sslconfig(sslconfig) builder() note if set to false, open ssl will be used to later check for whether native tls is being used bool enabled = extendedoptions isnativetlsenabled(); 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 extendedoptions enablesslcheck( false ); there is also a checker for whether ssl certificate verification is enabled bool enabled = extendedoptions issslcheckenabled();