Create Magento App
Create ScandiPWA AppScandiPWA DocsGitHub
v2
v2
  • Create Magento App
  • Getting started
    • Getting Started
    • Prerequisites
      • Linux requirements
      • MacOS requirements
        • Apple Silicon
      • Windows requirements
    • Available commands
      • Start the application
      • Stop the application
      • Check application status
      • Enter application CLI
      • Explore application logs
      • Execute commands in Docker containers
      • Link a theme
      • Import database dump
      • ⚠️ Uninstall a project
    • Folder structure
    • Updating to New Releases
      • Testing Alpha Releases
    • Configuration File
      • System Configuration File
    • Supported Magento versions
    • How does it work?
    • Limitations
    • What Is New in Version 2
  • Usage guide
    • Using console commands
    • Accessing Docker containers
    • Linking a Scandi Theme
    • Enabling XDebug
    • Enabling SSL
    • Configuring PHP
    • Configuring Multi-Store
    • Configuring NewRelic
    • Access on the local network
    • Using custom domain
    • Using Enterprise Edition
    • Using OpenSearch
    • Importing database
      • Importing remote database
    • Converting legacy Docker setup to CMA
    • Improve Performance
  • Container images
    • PHP Images
      • PHP 8.4
      • PHP 8.3
      • PHP 8.2
      • PHP 8.1
      • PHP 7.4
      • PHP 7.3
      • PHP 7.2
    • ElasticSearch Images
      • ElasticSearch 6.8
  • Scripts Extensions
    • PHP Extensions
      • PHP Extensions Package
      • (deprecated) ionCube Extension
  • Troubleshooting
    • Common Issues
    • CMA Debugging
    • Uninstall CMA
Powered by GitBook
On this page
  • Using an external SSL provider
  • Using local certificate
  • 1. Get a certificate
  • 2. Setup CMA

Was this helpful?

  1. Usage guide

Enabling SSL

PreviousEnabling XDebugNextConfiguring PHP

Last updated 18 days ago

Was this helpful?

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 command without .

You can run only one application with SSL enabled at the time because it will use port 443 which is the default port for SSL.

Using local certificate

1. Get a certificate

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

mkcert -install

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

> mkcert localhost 127.0.0.1

Created a new certificate valid for the following names 📜
 - "localhost"
 - "127.0.0.1"

The certificate is at "./localhost+1.pem" and the key at "./localhost+1-key.pem" ✅

It will expire on 13 May 2023 🗓

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:

cma.ks
module.export = {
    // other configuration
    ssl: {
        enabled: true,
        ssl_certificate: './localhost+1.pem',
        ssl_certificate_key: './localhost+1-key.pem'
    }
}

You can run only one application with SSL enabled at the time because it will use port 443 which is the default port for SSL.

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

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

mkcert
guide
start
start
-s option
-s option