I am trying to login to a Mariadb using SSL, in Python you can do this:
sl = {‘cert’: ‘/etc/mysql-ssl/client-cert.pem’, ‘key’: ‘/etc/mysql-ssl/client-key.pem’}
conn = MySQLdb.connect(host=’127.0.0.1′, user=’ssluser’, passwd=’pass’, ssl=ssl)
Can KnexJS support SSL?
The connection property of your knex config is proxied through to the underlaying client module when creating the connection, so you could try to do something like this:
db = knex({
client: 'mysql',
connection: {
host: 'localhost',
ssl : {
ca : fs.readFileSync(__dirname + '/mysql-ca.crt')
}
}
})
See https://www.npmjs.com/package/mysql#ssl-options for more detailed info.
Most helpful comment
The
connectionproperty of your knex config is proxied through to the underlaying client module when creating the connection, so you could try to do something like this:See https://www.npmjs.com/package/mysql#ssl-options for more detailed info.