byebot

Author Topic: Unable to activate a valid license in MATLAB R2017a and prior  (Read 347 times)

Developer Team

  • Staff
  • *
  • Posts: 6
    • View Profile
The issue:
Although after entering the license information the license is considered valid, the license cannot be activated in MATLAB R2017a or earlier.

After attempting activation the license status in the dialog shows:
Validation: LICENSE_VALID    Activation: ACTIVATION_SERVER_CONNECTION_ERROR

The cause
This behavior may be related to the fact that the License Activation Server for Code Checker for MATLAB uses LetsEncrypt certificates.

Per https://letsencrypt.org/docs/certificate-compatibility/ LetsEncrypt root certificates are not included in Java 7 < 7u111 and Java 8 < 8u101.

MATLAB R2017a and earlier ship with Java Runtime Environments that do not include the LetsEncrypt root certificates
To still use Code Checker for MATLAB with these MATLAB versins, the Let's Encrypt certificates  must be included in the MATLABs Java keystore.

The solution
Option 1
Code Checker for MATLAB comes with a utility and the certificates to update the MATLAB Java keystore.
It is necessary to have write access to the keystore, therefore run MATLAB as administrator and run:

Code: [Select]
>> monkeyproof.network.addLetsEncryptCerts()
Certficates may be removed of "forcefully" reinstalled by running:

Code: [Select]
>> monkeyproof.network.addLetsEncryptCerts('-remove')
or

Code: [Select]
>> monkeyproof.network.addLetsEncryptCerts('-force')
respectively.

Option 2
Alternatively you may install the certificates manually (it is necessary to have write access to the keystore).

Hints:
1. Find the LetsEncrypt certificates here: https://letsencrypt.org/certificates/

    Our utility installs:
  • ISRG Root X1 (self-signed)
  • Let’s Encrypt Authority X3 (IdenTrust cross-signed)
  • Let’s Encrypt Authority X3 (Signed by ISRG Root X1)
  • Let’s Encrypt Authority X4 (IdenTrust cross-signed)
  • Let’s Encrypt Authority X4 (Signed by ISRG Root X1)


2. MATLAB code to compose the system commands that add the certificates to the keystore (replace "letsEncryptCertAlias" and "letsEncryptCertFile" with the appropriate alias and file).
Code: [Select]
myKeystore = fullfile(matlabroot, 'sys', 'java', 'jre', computer('arch'), 'jre', 'lib', 'security', 'cacerts');
myKeytool  = fullfile(matlabroot, 'sys', 'java', 'jre', computer('arch'), 'jre', 'bin', 'keytool');
systemAddTrustCACertCommand = [...
            '"', myKeytool, '" -trustcacerts ', ...
            '-keystore "', myKeystore, '" ', ...
            '-alias ', 'letsEncryptCertAlias', ' ', ...
            '-storepass changeit ', ...
            '-noprompt ', ...
            '-importcert ', ...
            '-file "', 'letsEncryptCertFile', '"'];
« Last Edit: 15 August, 2019, 16:01:33 by CC4M Developer Team »