Configure SSL
Learn how to configure the Pdftools Licensing Gateway Service (LGS) to use the SSL and create HTTPS communication for your license key validation.
Before configuring SSL with the LGS, review Configure the LGS section.
SSL configuration
To enable SSL compatibility with LGS, follow these steps depending on your operating system:
- Windows
- Linux
- Docker
- Find the
appsettings.json
LGS configuration file. It is located in the installation folder. For example:C:\Program Files\Pdftools\Licensing Gateway Service\appsettings.json
- Add the following keys to your configuration file.
- Specify the port where SSL communication occurs:
LicensingServiceHTTPSPortNumber: 9990
- Add path to the certificate file:
CertPemFile: C:/certs/certificate.pem
- Add path to the private key file:
CertKeyFile: C:/certs/privatekey.key
warningInclude all files and configuration keys mentioned above. If you miss any of them the LGS doesn't activate SSL and defaults to HTTP communication.
- Specify the port where SSL communication occurs:
- Example configuration file:
{
"LicensingServicePortNumber": 9999,
"LogFilePath": "C:/logs/pdftls/log.txt",
"LogRetentionDays": 7,
"IsOfflineMode": false,
"LicensingServiceHTTPSPortNumber": 9990,
"CertPemFile": "C:/certs/cert.pem",
"CertKeyFile": "C:/certs/private-key.key"
} - Restart service after changing configuration by running the following command:
Stop-Service -Name "Licensing Gateway Service"
Start-Service -Name "Licensing Gateway Service"
- Find the
appsettings.json
LGS configuration file. It is located in the$SNAP_DATA
directory. For example:/var/snap/licgwy/current/appsettings.json
- Add the following keys to your configuration file.
- Specify the port where SSL communication occurs:
LicensingServiceHTTPSPortNumber: 9990
- Add path to the certificate file:
CertPemFile: C:/certs/certificate.pem
- Add path to the private key file:
CertKeyFile: C:/certs/privatekey.key
warningInclude all files and configuration keys mentioned above. If you miss any of them the LGS doesn't activate SSL and defaults to HTTP communication.
- Specify the port where SSL communication occurs:
- Example configuration file:
{
"LicensingServicePortNumber": 9999,
"LogFilePath": "/usr/share/Pdftools/lgs/logs/log.txt",
"LogRetentionDays": 7,
"IsOfflineMode": false,
"LicensingServiceHTTPSPortNumber": 9990,
"CertPemFile": "/etc/lgs/ssl/cert.pem",
"CertKeyFile": "/etc/lgs/ssl/private-key.key"
} - Restart service after changing configuration by running the following command:
sudo snap restart licgwy
- Add the following keys to your configuration file.
- Specify the port where SSL communication occurs:
LicensingServiceHTTPSPortNumber: 9990
- Add path to the certificate file:
CertPemFile: C:/certs/certificate.pem
- Add path to the private key file:
CertKeyFile: C:/certs/privatekey.key
warningInclude all files and configuration keys mentioned above. If you miss any of them the LGS doesn't activate SSL and defaults to HTTP communication.
- Specify the port where SSL communication occurs:
- Example of the complete run command:
docker run --name lgsdocker \
-e LICENSE_KEYS="YOUR_LICENSE_KEY" \
-e LicensingServicePortNumber=9999 \
-e LicensingServiceHTTPSPortNumber=9990 \
-e CertPemFile=/etc/lgs/ssl/cert.pem \
-e CertKeyFile=/etc/lgs/ssl/private-key.pem \
-v /etc/lgs/ssl/:/etc/lgs/ssl/ \
-p 9999:9999 \
-p 9990:9990 \
-d \
pdftoolsag/license-gateway:latest- Replace
YOUR_LICENSE_KEY
with the value of your license key. - Ensure that you certificates are reachable by storing them at
/etc/lgs/ssl/
in your host system. You can alternatively replace and customise all port numbers, values, and file paths, but ensure to edit the previous command example accordingly.
- Replace
If your configuration is correct, the LGS logs include information similar to:
[Information] Now listening on: "https://[::]:9990"