Reputation: 41
Following along with the Azure Documentation for their New MySQL service, it appears that you can setup SSL pretty simply with their Trusted CA Cert.
After following their steps and setting up my PHP connection string according to their docs, I get the following error:
Peer certificate CN=`AZUREREGION.control.database.windows.net' did not match expected CN=`MYDATABASE.mysql.database.azure.com' in testazure.php
I was able to "work around" the issue by changing my connection string's hostname from MYDATABASE.mysql.database.azure.com
to AZUREREGION.control.database.windows.net
but I feel like that's probably not what I should be doing. Any guidance from people more knowledgeable about either Azure Database for MySQL or PHP's SSL connections would be helpful!
----- UPDATE -----
I had previously accepted Jason's response below. His answer is NOT adequate. If you do as I mistakenly did above you WILL eventually experience an outage when MSFT decides to change the underlying DNS resolution for your database.
I ended up suffering an outage today because of this answer. I think you may need to answer my question more thoroughly. As I mentioned in my question, I felt like something was off by changing the "host" path to the region. About 20 minutes ago, your internal DNS service changed the underlying region record for "MYDATABASE.mysql.database.azure.com" to "cr2.MYREGION.control.database.windows.net" instead of "MYREGION.control.database.windows.net" without any warning. As such, I'm removing the accepted answer.
Upvotes: 4
Views: 1497
Reputation: 186
Your work-around is actually correct. As we were launching the service, we changed the DNS of the service to more accurately reflect your server, however we need to update the documentation as appropriate.
Thanks for reporting - we'll get the docs updated!
Jason Azure DB for MySQL team
Upvotes: 3