Execute Deployed Functions Using HTTPS
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.
Save SSL Certificate of Server
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.
Export and Save SSL Certificate
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
https://
using Google Chrome.your_server_FQDN
:port
/api/healthIn 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 Connection is Secure for a CA-signed SSL certificate or Certificate is not Valid for a self-signed SSL certificate. Then click 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.
Add Certificate to Windows Certificate Store
You can use a certificate management tool or Microsoft® Management Console (MMC) to add the server certificate to the Windows certificate store. For details on adding the certificate using MMC, see Add Certificates to the Certificate Store on the Microsoft website.
Specify Custom Path to Certificate
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.
>> prodserver.addon.set('CertificateFile','/path/to/my/certificate_name.certificate_extension')
Install Add-On Using HTTPS
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.
Install Add-On Using Command Line
Use the prodserver.addon.install
function and set the
TransportLayerSecurity
property to true
to use
HTTPS.
>> prodserver.addon.install('fractal','localhost', 9920, 'TransportLayerSecurity', true)
Install Add-On Using Graphical Interface
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.
Manage Default Protocol for Client-Server Communication
Set the protocol for client-server communication to HTTPS by using the prodserver.addon.set
function and setting the
TransportLayerSecurity
property to true
. The
protocol setting persists between MATLAB
sessions.
prodserver.addon.set('TransportLayerSecurity', true);
View the current value of the TransportLayerSecurity
property using
the prodserver.addon.get
function.
prodserver.addon.get('TransportLayerSecurity');
ans = logical 1
See Also
prodserver.addon.install
| prodserver.addon.get
| prodserver.addon.set
| prodserver.addon.accessTokenPolicy