• Resolved mdm2812

    (@mdm2812)


    How can I specify in the plugin a local certificate used to verify the client to a TLS server and achieve “Trusted TLS” for the communication.

    The plugin works fine for an “Anonymous TLS” to an SMTP server but I cannot achieve “Trusted TLS” without have the plugin also pass my certificate.

    I also know the certificate I want to use works because if I send mail using postfix outside of the plugin, I get a “Trusted TLS” connection.

    I have tried the following snippet to add in the cert to no avail:

    add_filter(‘wp_mail_smtp_custom_options’, function( $phpmailer ) {
    $phpmailer->SMTPOptions = array(
    ‘ssl’ => array(
    ‘local_cert’ => ‘/etc/ssl/private/cert.pem’
    )
    );
    return $phpmailer;
    }
    );

    Your help is appreciated.

    M

Viewing 1 replies (of 1 total)
  • Plugin Author Slava Abakumov

    (@slaffik)

    Hi

    You can try to use $phpmailer->sign() method in that filter. So it will be like this:

    
    add_filter('wp_mail_smtp_custom_options', function( $phpmailer ) {
        // $phpmailer->sign( $cert_filename, $key_filename, $key_pass, $extracerts_filename = '' );
        $phpmailer->sign('/path/to/cert.crt', '/path/to/cert.key', 'yourSecretPrivateKeyPassword', '/path/to/certchain.pem');
        return $phpmailer;
    } );
    

    For more info you will need to check that method inside wp-includes/class-phpmailer.php file.

Viewing 1 replies (of 1 total)
  • The topic ‘Using SSL cert for ‘Trusted TLS’ connection’ is closed to new replies.