<p><strong>Update:</strong></p>

<p>As of the next Craft 2.6 release (<a href="https://craftcms.com/changelog#build2945" rel="nofollow">post 2.6.2945</a>), Craft has exposed an <code>attributes</code> database config setting that you can pass arbitrary <a href="https://secure.php.net/manual/en/pdo.setattribute.php" rel="nofollow">PDO attribute</a> <code>key =&gt; value</code> pairs into.</p>

<p>So, assuming your MySQL box is setup <a href="https://dev.mysql.com/doc/refman/5.5/en/using-secure-connections.html" rel="nofollow">properly to use SSL</a> and assuming the database user that Craft is using to connect to the box can connect over SSL, then you can do something like this to enable Craft to talk to MySQL over SSL:</p>

<pre><code>'attributes' =&gt; array(
     PDO::MYSQL_ATTR_SSL_KEY    =&gt; '/path/to/my/client-key.pem',
     PDO::MYSQL_ATTR_SSL_CERT   =&gt; '/path/to/my/client-cert.pem',
     PDO::MYSQL_ATTR_SSL_CA     =&gt; '/path/to/my/ca-cert.pem',
 ),
</code></pre>

<hr>

<p><strong>Original</strong>:</p>

<p>In Craft 2.x, this isn't currently possible.  Craft 3, however, will expose the necessary client side configs so that if your MySQL box has an SSL cert installed and supports SSL, then you can configure Craft to connect via SSL.</p>

CC BY-SA 3.0
2016-03-16T06:14:23.447Z
Thanks Brad. Do you have a link that documents the setup? I've looked on the craft website but can't find anything.
Gerhard
CC BY-SA 3.0
2016-03-16T07:26:28.253Z
Craft 3 isn't even in beta, there's no documentation yet.
carlcs
CC BY-SA 3.0
2016-03-16T00:48:08.897Z
2016-09-30T22:53:57.627Z
2016-09-30T22:53:57.627Z
Brad Bell
<p>Does Craft CMS support MySQL over SSL?</p>

<p>Thanks!</p>

<mysql><ssl>
Does Craft CMS support MySQL over SSL?
# Does Craft CMS support MySQL over SSL?

(Asked by: username_0 on 2016-03-15)

Does Craft CMS support MySQL over SSL?

Thanks!

**Tags:** mysql, ssl


---

## 1 answers

### Answer by username_1 on 2016-03-16. Score: 5 | Accepted answer

Update:
As of the next Craft 2.6 release (post 2.6.2945), Craft has exposed an attributes database config setting that you can pass arbitrary PDO attribute key => value pairs into.
So, assuming your MySQL box is setup properly to use SSL and assuming the database user that Craft is using to connect to the box can connect over SSL, then you can do something like this to enable Craft to talk to MySQL over SSL:
'attributes' => array(
     PDO::MYSQL_ATTR_SSL_KEY    => '/path/to/my/client-key.pem',
     PDO::MYSQL_ATTR_SSL_CERT   => '/path/to/my/client-cert.pem',
     PDO::MYSQL_ATTR_SSL_CA     => '/path/to/my/ca-cert.pem',
 ),


Original:
In Craft 2.x, this isn't currently possible.  Craft 3, however, will expose the necessary client side configs so that if your MySQL box has an SSL cert installed and supports SSL, then you can configure Craft to connect via SSL.

> **Comments:**
> **username_0**: Thanks Brad. Do you have a link that documents the setup? I've looked on the craft website but can't find anything.  
> **username_2**: Craft 3 isn't even in beta, there's no documentation yet.  

---

