title: Authenticating with office365 relay connector via digital certificate in swift mailer
body: <p>I'm transferring from a IP based office365 exchange connector to a digital certificate one as I'm moving to a elastic beanstalk web cluster which won't have a single ip for me to authenticate on</p>
  
  <p>I've tried reading the limited documentation available here <a href="https://docs.microsoft.com/en-us/previous-versions/exchange-server/exchange-150/dn910993(v=exchg.150)" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/previous-versions/exchange-server/exchange-150/dn910993(v=exchg.150)</a> which helped me figure out I need to send a TLS certificate with a specific domain, but I don't know how to actually send that certificate in PHP with SwiftMailer</p>
  
  <p>The closest example I've found is this example</p>
  
  <pre><code>$mail-&gt;SMTPSecure = 'tls';
  $mail-&gt;Port = 587;
  $mail-&gt;SMTPAuth = false;
  $mail-&gt;SMTPOptions = [
      'ssl' =&gt; [
          'verify_peer'  =&gt; true,
          'local_cert' =&gt; '/path/to/client_cert_and_key.pem'
      ]
  ];
  </code></pre>
  
  <p>where local_cert would be my digital certificate, but I'm not sure how I would generate a certificate with the correct domain, can I just re-use my HTTPS cert?</p>