Home
About
Search
Welcome to M-Files Empower – our new support experience. We'd love to hear what you think!Give feedback
Home/Support and troubleshooting/Examples and how to

Example of how to generate a self-signed certificate to use with M-Files

Last updated on 17 November 2025

Admin
M-Files Admin

Overview

To use SSL with M-Files servers, you will need a certificate to be installed on the M-Files server and trusted by the client. When testing, it may be more prudent to create and use a self-signed certificate. There are certain requirements this certificate must meet in order to work with certain M-Files setups, which this article will outline, along with some example guides for creating such certificates.

Support Disclaimers

This example is provided as-is to help in getting started with certificates in M-Files. M-Files does not support or assist with the generation or configuration of certificates or the distribution of certificates to clients.

It is highly recommended to use a trusted certificate from a Root Certificate Authority for any production M-Files servers. Self-signed certificates are recommended for testing and development only.

Requirements

The minimum requirements for an on-prem M-Files server are:

  • PFX certificate, to be trusted by any clients connecting to this M-Files server (NOTE: this certificate must usually be trusted in the client's Trusted Root Certificate Authorities store of both the  Local Machine and Current User certificate stores).
  • PEM-formatted public certificate, to be installed to the M-Files server.
  • PKCS#1-formatted encrypted key, to be installed to the M-Files server.

The certificate settings must include:

  • KeyUsage - includes both keyEncypherment and digitalSignature.
  • Any DNS names used to access this M-Files server must be included. For example, through Text Extensions/Alternate Names.

An example guide for generating, configuring, and installing these files is provided below, but you can generate and configure these files however you wish based on your own environment needs.

Example

This method uses Cygwin to access OpenSSL to generate the required certificates. At the time of this writing, Cygwin comes with OpenSSL 3 in the default installation, which is sufficient for this example. Certificates created with tools other than Cygwin/OpenSSL may be incompatible. Nevertheless, similar commands and logic may be suitable for other generation and conversion needs you may have. You can and should adapt the example as needed for your situation.

Generating the required files

  1. Create an example-com.conf file with the following contents:

    #Do not change these settings
    [ req ]
    default_bits        = 2048
    default_keyfile     = server-key.pem
    distinguished_name  = subject
    req_extensions      = extensions
    x509_extensions     = extensions
    string_mask         = utf8only

    #Adjust these settings based on your organization
    [ subject ]
    countryName         = US (2 letter code)
    countryName_default     = US

    stateOrProvinceName     = New York (full name)
    stateOrProvinceName_default = NY

    localityName            = New York (eg, city)
    localityName_default        = New York

    organizationName         = Example, LLC (eg, company)
    organizationName_default    = Example, LLC

    commonName          = Example, LLC (e.g. server FQDN or YOUR name)
    commonName_default      = Example, LLC

    emailAddress            = test@example.com
    emailAddress_default        = test@example.com

    #Do not change these settings
    [ extensions ]

    subjectKeyIdentifier        = hash
    authorityKeyIdentifier  = keyid,issuer

    basicConstraints        = CA:FALSE
    keyUsage            = nonRepudiation, digitalSignature, keyEncipherment
    extendedKeyUsage    = serverAuth
    subjectAltName          = @alternate_names
    nsComment           = "OpenSSL Generated Certificate"

    #Adjust the DNS.X options as necessary, there can be as
    #many or as few as needed
    #These are required if there are multiple DNS names that
    #are used to connect to M-Files, and if there are multiple
    #vaults on the same server
    #Wildcards (*) also work
    [ alternate_names ]

    DNS.1       = WIN-B1KF7S80A5H
    DNS.2       = 169.254.10.58
    DNS.3       = vault-1.mycompany.com
    DNS.4       = vault2
    DNS.5       = *.mycompany.com

     
  2. Open Cygwin Terminal and navigate to where the example-com.conf is stored

    Because Cygwin is a Unix-style terminal, the path will be slightly different than a Windows path. For example, if the example-com.conf is stored at "C:\temp\cert", the command in Cygwin would be:
    cd /cygdrive/C/temp/cert 
    (note the forward slashes '/' rather than backslashes '\')

     
  3. In Cygwin Terminal, run the command:
    openssl req -config example-com.conf -new -x509 -newkey rsa:2048 -nodes -keyout example-com.key.pem -days 365 -out example-com.cert.pem

    This generates the PEM certificate and the encrypted key in the same directory as the example-com.conf file ("example-com.cert.pem" and "example-com.key.pem")

    This command generates a certificate that is valid for 365 days, the respective command can be changed for a different validity period.

    The certificate file content should look like:

    -----BEGIN CERTIFICATE-----
    <certificate content>
    -----END CERTIFICATE-----

    The key file content should look like:

    -----BEGIN PRIVATE KEY-----
    <key content>
    -----END PRIVATE KEY-----

     
  4. In Cygwin Terminal, run the command:
    openssl pkcs12 -inkey example-com.key.pem -in example-com.cert.pem -export -out example-com.pfx

    This will ask you to enter an export password, this is a security measure, and can be whatever value you wish, note this password as it will be used for the installation of the certificate on the client later, and it is sensitive information.

    This generates the PFX certificate that can be trusted on the client machines ("example-com.pfx")

     

Installing the certificate to M-Files Server

  1. In the M-Files Admin left pane, right click on the Local Computer server > Manage Server Certificate…
    A computer screen shot of a computer         AI-generated content may be incorrect.

     
  2. Check the "Use a TLS certificate" box

     
  3. Click Change… under the Private key heading, and open the "example-com.key.pem" file
    A screenshot of a computer         AI-generated content may be incorrect. A screenshot of a computer         AI-generated content may be incorrect.

     
  4. Click Change… under the Certificate heading, and open the "example-com.cert.pem" file
    A screenshot of a computer         AI-generated content may be incorrect. A screenshot of a computer         AI-generated content may be incorrect.

     
  5. Click OK, then Yes on the next prompt (warning about a short interruption for users)
    A screenshot of a computer         AI-generated content may be incorrect.

Trust the certificate on the clients

To trust a certificate manually follow this process. Note that you need computer administrator privileges.

  1. Copy the PFX certificate to the client machine

     
  2. Double-click the PFX file

     
  3. In the Certificate Import Wizard, select Local Machine as the Store Location, then click Next
    A screenshot of a certificate         AI-generated content may be incorrect.

     
  4. Verify the correct certificate is being imported, then click Next
    A screenshot of a computer         AI-generated content may be incorrect.

     
  5. Enter the export password that was created during step 4a, then click Next
    A screenshot of a login box         AI-generated content may be incorrect.

     
  6. Select "Place all certificates in the following store", then click Browse… and select "Trusted Root Certification Authorities", then click OK and Next
    A screenshot of a certificate         AI-generated content may be incorrect.

     
  7. Click Finish.

    The installation can be verified by opening "Manage computer certificates" in the Windows Control Panel, then navigating to Trusted Root Certification Authorities > Certificates and finding the Common Name you entered upon creation of the certificate
    A screenshot of a computer         AI-generated content may be incorrect.

     
  8. Repeat the process for any clients that will connect to this M-Files server

Notes

Note that this is just an example of doing this task manually, so this is suitable for testing/development purposes. If you need this one more computers, consider seeking a away to automate this, e.g., via tools like GPO.

This example uses the Machine Certificate Store, because this is the store that M-Files Client uses. Other applications may use the User Certificate Store so you may need to repeat the process for it as well.

Note also that this process applies to self-signed certificates that do not have an issuer. If your company uses its own trusted root certificate added as a trusted root certification authority, the process will be different and it may also include trusting intermediate certificates. This type of certificate trust is not specific to M-Files and M-Files does not impose limitations or requirements on this part of the process.

Still need help?