I have seen
$mail->SMTPOptions = array( 'ssl' => array( 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true ) );
With phpmailer, but I believe this is an old use case and not sure if it’s applicable anymore. I have a cpanel autossl certificate running on the domain.