Main Content

Enable SSL on MATLAB Web App Server

SSL (Secure Sockets Layer) is a networking protocol that encrypts data sent between clients and servers. On MATLAB® Web App Server™, SSL setup requires a certificate and private key pair.

Restrictions

The certificate must conform to the following restrictions:

  • Format: MATLAB Web App Server only supports the .pem SSL certificate format.

  • Key Length: SSL keys must be private and must be at least 2048 bits and up to 4096 bits in length (support for 4096-bit keys was introduced in R2023a Update 3).

  • Intermediate Certificates: To use intermediate certificates, you must provide a single certificate chain file. The .pem file must contain the server certificate followed by the intermediate certificates concatenated in order.

  • Private Key: The private key must not be password protected.

  • Permissions: The certificate and private key files must be readable by the server service account, such as MwWebAppsServerR2026a. It is strongly recommended to store these files in the webapps_private folder, as it is pre-configured with the necessary permissions. If files are stored elsewhere, the service account must have explicit Read access to the files and Execute/Traverse permissions for all parent directories in the path. For the location of the webapps_private folder, see Authentication.

Enable SSL

To enable Secure Sockets Layer (SSL) on the server:

  1. Obtain a certificate file and private key file for the server from a certificate authority and place these files in a location accessible to the MATLAB Web App Server.

  2. At the terminal, navigate to the folder containing MATLAB Web App Server command-line scripts.

    Operating SystemDefault Location of Command-Line Scripts

    Windows® (Administrator)

    C:\Program Files\MATLAB\MATLAB Web App Server\R2026a\script

    Linux® (sudo)

    /usr/local/MATLAB/MATLAB_Web_App_Server/R2026a/script

    macOS (sudo)

    /Applications/MATLAB/MATLAB_Web_App_Server/R2026a/script

  3. At the terminal, type:

    webapps-config set ssl_certificate_file <path to certificate file>

  4. At the terminal, type:

    webapps-config set ssl_private_key_file <path to private key file>
  5. At the terminal, type:

    webapps-config set ssl_enabled true

  6. Restart the server.

See Also

Topics

External Websites