Connecting to a MATLAB® Production Server™ instance over HTTPS provides a secure channel for executing MATLAB functions. To establish an HTTPS connection with a MATLAB Production Server instance:
Ensure that the server instance is configured to use HTTPS. For more information, see Enable HTTPS.
If the server instance uses a self-signed SSL certificate or if the root certificate of the server is not present in the trust store of the client machine, you must save the server certificate on the client machine.
Install MATLAB Production Server add-ons using HTTPS.
MATLAB Client for MATLAB Production Server does not support sending a client certificate to the server. Therefore, you cannot use MATLAB Client for MATLAB Production Server to install add-ons from a server or execute functions deployed to a server that has client authentication enabled.
Before your client application can send HTTPS requests to a server instance, the root SSL certificate of the server must be present in the Windows® Trusted Root Certification Authorities certificate store or Linux® trust store of the client machine. If the server uses a self-signed SSL certificate or if the root certificate of the server signed by a certificate authority (CA) is not present in the Windows certificate store, obtain the server certificate from the MATLAB Production Server administrator or export the certificate using a browser, then add it to the certificate store or the trust store.
You can use any browser to save the server certificate on the client machine. The procedure to save the certificate using Google Chrome™ follows.
Navigate to the server instance URL
using Google Chrome.
In the Google Chrome address bar, click the padlock icon or the warning icon, depending on whether the server instance uses a CA-signed SSL certificate or a self-signed SSL certificate.
Click Certificate > Details > Copy to File. Doing so opens a wizard that lets you export the SSL certificate. Click Next.
Select the format to export the certificate and click Next.
Specify the location and file name to export the certificate, then click Next.
Click Finish to complete exporting the certificate.
You can use a certificate management tool or Microsoft® Management Console (MMC) to add the server certificate to the Windows certificate store. The procedure to add the certificate using MMC follows.
Open MMC from your Windows machine.
Click File > Add/Remove Snap-in. Doing so opens the Add or Remove Snap-ins window.
In the Add or Remove Snap-ins window:
Click Certificates from the left pane, then click Add.
Select Computer account, then click Finish. Doing so adds Certificates(Local Computer) to the right pane.
Click OK. Doing so takes you to the home window.
In the left pane of the home window, under Console Root, double click Certificates(Local Computer). Doing so opens all the certificate folders located in the local machine.
Select Trusted Root Certification Authorities > More Actions > All Tasks > Import. Doing so opens the Certificate Import Wizard.
Click Next, then select the location of your server certificate.
Click Next to import the certificate in the Trusted Root Certification Authorities certificate store.
MATLAB Client for MATLAB
Production Server searches the default trust store for the server certificate, but also
supports specifying the full path to a certificate file. Typically, you want to specify a
path to the server certificate during testing. To do so, set the
CertificateFile property using the
prodserver.addon.set function. The value of the
CertificateFile property persists between MATLAB sessions.
The default protocol for communication with the server is HTTP. If the server uses HTTPS, you must install an add-on from that server using HTTPS. Your MATLAB session can use HTTP with one server and HTTPS with another server simultaneously.
prodserver.addon.install function and set the
TransportLayerSecurity property to
true to use
>> prodserver.addon.install('fractal','localhost', 9920, 'TransportLayerSecurity', true)
In the Servers section in the MATLAB Production Server Add-On Explorer app, click New. Doing so opens a dialog box where you enter details about the MATLAB Production Server instance that the MATLAB client wants to communicate with using HTTPS.
Enter the host name and port number of the server instance, select HTTPS, then click OK. Doing so enables HTTPS communication between your MATLAB client and the server instance.
Set the protocol for client-server communication to HTTPS by using the
prodserver.addon.set function and setting the
TransportLayerSecurity property to
protocol setting persists between MATLAB
View the current value of the
TransportLayerSecurity property using
ans = logical 1