mps-cert
R2026bCreate root certificate authority and leaf certificate for a single server instance
Since R2026b
Syntax
mps-cert [-C [path/]server_name]
[-f, --force-delete] [-l, --leaf-only] [--root-cert-exp-time root-cert-exp-time] [--root-dn-config-file root_dn_config_file] [--root-dn-str root_dn_string] [--san san] [--server-cert-exp-time server-cert-exp-time] [--server-dn-config-file server_dn_config_file][--server-dn-str server_dn_string] [-v, --verbose]
Description
mps-cert [-C [
generates a self-signed root certificate authority (CA), then a server certificate that
is signed by the root certificate authority.path/]server_name]
[-f, --force-delete] [-l, --leaf-only] [--root-cert-exp-time root-cert-exp-time] [--root-dn-config-file root_dn_config_file] [--root-dn-str root_dn_string] [--san san] [--server-cert-exp-time server-cert-exp-time] [--server-dn-config-file server_dn_config_file][--server-dn-str server_dn_string] [-v, --verbose]
Input Arguments
| Path to the server instance. If you want to generate a certificate for the server instance in the current working folder, you do not need to specify a full path; only specify the server name. If you omit this option, the system searches the current working folder and its parents to find the server instance. |
| Name of the server for which to generate a certificate. |
| A configuration file that contains the distinguished name of the root CA. This is optional. |
| A comma-separated string representing the distinguished name of the root
CA. This is optional. The string should be in the format
|
| A comma-separated string of Subject Alternative Name (SAN) entries for the
server certificate. Each entry can be a DNS name or IP address. For example,
|
| A configuration file that contains the distinguished name of the server certificate. This is optional. |
| A comma separated string representing the distinguished name for the
server certificate. This is optional. The string should be in the format
|
| Root certificate expiration time in days. This is optional. The default is 375 days. |
| Server certificate expiration time in days. This is optional. The default is 90 days. |
| Only generate leaf server certificate if the self-signed root CA is already generated. This is optional. |
| Force delete of existing private key and certificate files before regenerating new ones. This is optional. |
| Whether to use verbose mode. This is optional. |
Examples
Generate a self-signed certificate for the MATLAB®
Production Server™ instance mpsTest.
Type the following at the system command prompt:
mps-cert -C /home/work/mpsTestGenerated Self-signed certificate for host1.example.com in /home/work/mpsTest/x509/ folder Please set --x509-private-key to /home/work/mpsTest/x509/server_key.pem in main_config Please set --x509-cert-chain to /home/work/mpsTest/x509/server_cert.pem in main_config Please set --https to the desired HTTPS port number in main_config Please import /home/work/mpsTest/x509/server_ca_cert.pem to client's trust store to avoid client warning or error.
This generates the files .server_ca_key.pem,
server_ca_cert.pem, server_key.pem and
server_cert.pem in the x509 folder. For more
information about using the generated certificates, see Configure Client Authentication.
Tips
Run
mps-certfrom thefolder. Alternatively, add theserver_install_location/scriptscriptfolder to your systemPATHenvironment variable to runmps-certfrom any folder on your system.After running
mps-cert -C, set thepath/server_name--x509-private-keyand--x509-cert-chainproperties in themain_configfile.Set
--x509-private-keyto<server_name>/x509/server_key.pem.Set
--x509-cert-chainto<server_name>/x509/server_cert.pem.
For more information, see Server Configuration Properties.
If the server certificate expires, you can run
mps-cert -Cto regenerate the server certificate and restart the server.path/server_name-l -fIf both the root certificate and server certificate expire, you can use
mps-cert -Cto regenerate both the root and server certificate and restart the server. Then, import the newpath/server_name-f<instance_root>/x509/server_ca_cert.pemfile into the client's trust store.
Version History
Introduced in R2026b