Enabling SSL

Using an external SSL provider

Available since magento-scripts 2.2.0

If you are using an external SSL provider, like Ngrok, you will need to use the following configuration:

cma.js
module.export = {
    // other configuration
    ssl: {
        enabled: true,
        external_provider: true // <- enable this
    },
    storeDomains: {
        admin: 'a9a9-9999-99-999-99.ngrok-free.app' // <- put your domain here
    }
}

That is it! Just now we have enabled SSL in our application! With storeDomains you can expose any store in your instance.

Now to apply changes we need to run start command without -s option.

Using local certificate

1. Get a certificate

You can use your existing certificate or create a new one using mkcert utility. Follow the installation guide for your platform.

After installation install mkcert certificate into your system by running the command below:

Now we need to create a certificate. To create a certificate run command below:

Now we have all files that we need for CMA config.

2. Setup CMA

Add to your cma.js file field ssl with the following object:

That is it! Just now we have enabled SSL in our application! Now to apply changes we need to run start command without -s option.

Last updated

Was this helpful?