Krunal
Krunal

Reputation: 3269

Error: Connections using insecure transport are prohibited while --require_secure_transport=ON in Mautic Docker container to Azure MySQL

I'm trying to set up Mautic in a Docker container with an Azure Database for MySQL backend. However, I'm encountering the following error:

Warning: mysqli::__construct(): (HY000/3159): Connections using insecure transport are prohibited while --require_secure_transport=ON. in /makedb.php on line 20 MySQL Connection Error: (3159) Connections using insecure transport are prohibited while --require_secure_transport=ON.

Here are the details of my setup:

version: "2"

services:

  mautic:
    container_name: mautic
    image: mautic/mautic:v4-apache
    volumes:
      - mautic_data:/var/www/html
    environment:
      - MAUTIC_DB_HOST=mydbase.mysql.database.azure.com
      - MAUTIC_DB_USER=mydbuser
      - MAUTIC_DB_PASSWORD=mydbuserpwd
      - MAUTIC_DB_NAME=mydbname
    restart: always
    networks:
      - mauticnet
    ports:
      - "8880:80"

networks:
  mauticnet:

volumes:
  mautic_data:

My Azure Database for MySQL has SSL enabled by default, and I have successfully connected to it using a separate tool outside the Mautic container. However, when running the Mautic container, I encounter the aforementioned error related to secure transport.

I suspect there might be an issue with how the Mautic container handles SSL/TLS when connecting to the Azure Database for MySQL.

Could someone please guide me on how to resolve this error and establish a secure connection between Mautic and Azure Database for MySQL within the Docker container?

Any insights or suggestions would be greatly appreciated. Thank you in advance!

Upvotes: 3

Views: 23602

Answers (2)

Devean
Devean

Reputation: 31

require_secure_transport config conment

Whether client connections to the server are required to use some form of secure transport. When this variable is enabled, the server permits only TCP/IP connections that use SSL, or connections that use a socket file (on Unix) or shared memory (on Windows).

use two ways:

  • config mysql system config require_secure_transport=off
  • client connect mysql server use SSL/TLS protocol config

Documentation require_secure_transpor: https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_require_secure_transport

Upvotes: 4

Krunal
Krunal

Reputation: 3269

This was solved by setting require_secure_transport to false into Database Server Parameters into Azure DB for MySQL.

Upvotes: 3

Related Questions