Hello,
My C++ app works well using LexActivator and I can activate trials or licenses.
Now, I’m trying to package my app as an AppImage since it is dedicated to Linux. When doing so I incorporate libLexActivator.so and dependencies in the AppImage. Each time I’m running the generated AppImage, ActivateTrial() or ActivateLicense() return LA_E_INET. If I use “system( “ping www.google.com” )” from the code, I see that I have Internet access.
Any idea about what could go wrong? Is there a way I can trigger logs?
Thank you,
Xavier
Hi Xavier,
Try using the following app inside appimage. It does console log of network request:
Hello and thank you for providing this tool.
First I ran it “natively” and it executed without issue:
- Trying 54.147.163.93…
- TCP_NODELAY set
- Connected to api.cryptlex.com (54.147.163.93) port 443 (#0)
- Initializing NSS with certpath: none
- WARNING: failed to load NSS PEM library libnsspem.so. Using OpenSSL PEM certificates will not work.
- warning: ignoring value of ssl.verifyhost
- CAfile: none
CApath: none - loaded libnssckbi.so
- skipping SSL peer certificate verification
- ALPN/NPN, server did not agree to a protocol
- SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
- Server certificate:
-
subject: CN=cryptlex.com
-
start date: Apr 26 00:00:00 2020 GMT
-
expire date: May 26 12:00:00 2021 GMT
-
common name: cryptlex.com
-
issuer: CN=Amazon,OU=Server CA 1B,O=Amazon,C=US
POST /v3/trial-activations HTTP/1.1
Host: api.cryptlex.com
Accept: /
Content-Type: application/json
Content-Length: 707
- upload completely sent off: 707 out of 707 bytes
When loaded into AppImage I get:
- Trying 54.147.158.222…
- TCP_NODELAY set
- Connected to api.cryptlex.com (54.147.158.222) port 443 (#0)
- Initializing NSS with certpath: none
- Unable to initialize NSS
- Closing connection 0
Network error: Problem with the SSL CA cert (path? access rights?)
Time taken for network request: 0.00s
Both runs were done on the same machine, same distro (Ubuntu 19.10), same system.
I used linuxdeploy in order to generate the AppDir, which means that the provided libLexActivator.so, libssl3.so, libnss3.so, libnspr4.so, libnssutils3.so, libplc4.so and libplds4.so are also loaded in the generated AppImage.
After a few hours of investigation, it looks like linuxdeploy doesn’t include all the libraries needed by the included nss3 library.
I could find a solution that works (at least when running the following script on Ubuntu)
#!/bin/bash
rm -Rf AppDir
mkdir AppDir
cd AppDir
mkdir usr
cd usr
mkdir bin
mkdir lib
mkdir share
mkdir share/icons
cp …/…/NetworkTester.png share/icons/NetworkTester.png
cd …/…
cp ./NetworkTester AppDir/usr/bin
cp -r /usr/lib/x86_64-linux-gnu/nss/* AppDir/usr/lib
linuxdeploy-x86_64.AppImage --appdir AppDir --create-desktop-file --executable=AppDir/usr/bin/NetworkTester -i AppDir/usr/share/icons/NetworkTester.png --output appimage
Thanks again for your help!
Glad you figured it out. The log pointed to the missing library which was needed for loading the certificates.