Hi- We're looking to move our dev server to use Azure. The database requires an SSL connection. Is there a way to set Perch to do this?

Azure DB
- ashafer
- Thread is marked as Resolved.
-
-
-
The Perchology Slack invite link isn't valid anymore. Do you know anyone there that can fix that?
-
try this... https://perchology.slack.com/
-
Join the Slack group here https://join.slack.com/t/perch…A3ZWM0MzU1NTg2NDg1ZmIyOTM
-
Have you checked all the options here? https://docs.grabaperch.com/perch/configuration/database/
If there's something you need to be able to set but can't, we're just using PDO so it should be easy to add.
-
As Joridon pointed out on the Slack channel.. here's the issue.
I don’t think perch currently allows you to connect like this. You’d need to implement connecting to mysqli like shown in Hussein’s link :
```
$conn = mysqli_init();
mysqli_ssl_set($conn,NULL,NULL, "/var/www/html/BaltimoreCyberTrustRoot.crt.pem", NULL, NULL) ;
mysqli_real_connect($conn, 'mydemoserver.mysql.database.azure.com', 'myadmin@mydemoserver', 'yourpassword', 'quickstartdb', 3306, MYSQLI_CLIENT_SSL);
if (mysqli_connect_errno($conn)) {
die('Failed to connect to MySQL: '.mysqli_connect_error());
}
```
Currently perch just uses simple mysqli :
```
$this->link = new mysqli($this->config('PERCH_DB_SERVER'), $this->config('PERCH_DB_USERNAME'), $this->config('PERCH_DB_PASSWORD'), $this->config('PERCH_DB_DATABASE'), $this->config('PERCH_DB_PORT'), $this->config('PERCH_DB_SOCKET')); -
I ended up having to disable required SSL in Azure.