SQL communication TLS/SSL encryption and error self_signed_cert_in_chain solution

I was using the node-red-contrib-stackhero-mysql as I wanted secure SSL connection to a mariadb 10.x. The first issue was that on Debian/Ubuntu a custom SSL library is used for Mariadb and not the openssl library and it did not work as there was a cipher issue (you may compile mariadb with openssl to be used but I just switched to another Linux :smile: ). I installed mariadb 10.x on centos7 but not now I saw a new issue after solving the first because I was using a not public CA signed certificate and using the solution for HTTP communication like " NODE_TLS_REJECT_UNAUTHORIZED=0 " did not help at all. Finally looking at mysql - npm and the "SSL options" I got the idea to add to the main.js file under """<home/user or root>node-red/node_modules/node-red-contrib-stackhero-mysql/src"" this code " ssl: {rejectUnauthorized: false}, " (I insatalled node-red during being a root user so this is why it was under root not home/<user_dir>).

 // Note: the connection is not done here
  this.pool = mysql.createPool({
    host: config.host,
    port: config.port,
    user: this.credentials.user,
    password: this.credentials.password,
    database: config.database,
    waitForConnections: true,
    connectionLimit: 5,
    queueLimit: 0,
    connectTimeout: 1000,
    ssl: config.tls ? {} : false,
    ssl: {rejectUnauthorized: false},

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.