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\R2020b\script

    Linux® (sudo)

    /usr/local/MATLAB/MATLAB_Web_App_Server/R2020b/script

    macOS (sudo)

    /Applications/MATLAB/MATLAB_Web_App_Server/R2020b/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.

Note

The private key file must be in a location that is readable only by the server account.

A convenient location to store the certificate file and private key file is the webapps_private folder. For the location of the webapps_private folder, see Authentication.

Related Topics