Question: how to fix the name on the security certificate is invalid?
Answer: Create a new SRV record. ... 
Before you remove the existing A record, the new SRV record should be tested by changing a user's host file to redirect the current A record to an invalid IP. ... 
When the SRV record works as expected, you can remove the existing A record from DNS.