• Resolved RChadwick

    (@rchadwick)


    I run my own email server, and have never needed anything more than a self-signed certificate for SSL. However, WP Mail SMTP throws an error about a misconfigured server certificate. Is there a way to configure WP Mail SMTP to ignore certificate errors?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Gregor Capuder

    (@capuderg)

    Hi @rchadwick,

    could you please share the full debug log that you get when you try to send a test email?

    So we can see what the error message says and can help you out.

    Take care!

    Thread Starter RChadwick

    (@rchadwick)

    Thanks. Here it is:

    Versions:
    WordPress: 5.5.3
    WordPress MS: No
    PHP: 7.4.12
    WP Mail SMTP: 2.5.1

    Params:
    Mailer: smtp
    Constants: No
    ErrorInfo: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
    Host: mail.primeroselane.org
    Port: 465
    SMTPSecure: ssl
    SMTPAutoTLS: bool(false)
    SMTPAuth: bool(true)

    Server:
    OpenSSL: OpenSSL 1.1.1d 10 Sep 2019
    Apache.mod_security: No

    Debug:
    Mailer: Other SMTP
    SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    SMTP Debug:
    2020-11-20 05:10:36 Connection: opening to ssl://mail.primeroselane.org:465, timeout=300, options=array()

    2020-11-20 05:10:36 Connection failed. Error #2: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed [/home/gilesmkeo/public_html/primeroselane.org/wordpress/wp-includes/PHPMailer/SMTP.php line 344]

    2020-11-20 05:10:36 Connection failed. Error #2: stream_socket_client(): Failed to enable crypto [/home/gilesmkeo/public_html/primeroselane.org/wordpress/wp-includes/PHPMailer/SMTP.php line 344]

    2020-11-20 05:10:36 Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://mail.primeroselane.org:465 (Unknown error) [/home/gilesmkeo/public_html/primroselane.org/wordpress/wp-includes/PHPMailer/SMTP.php line 344]

    2020-11-20 05:10:36 SMTP ERROR: Failed to connect to server: (0)

    SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi @rchadwick,

    thank you for providing the debug log.

    As you can see the error is related to the certificate. There are a few possibilities as to what the actual problem is… please visit this Troubleshooting guide, more specifically the “Certificate verification failure” section.

    Verify the things they suggest and you should find what is causing the issue for you.

    Let us know what the solution for you was.

    Have a nice day!

    Hi @rchadwick – As Gregor suggested you’ll need to fix your certificate. If you’d like to use a self-signed certificate and disable SSL verification, you can use this custom codes. Please note that it is compromising your security. In case it helps, here’s how to add custom codes like that.

    I hope this helps!

    Thread Starter RChadwick

    (@rchadwick)

    It helps. It’s on my to-do list today to look into those custom codes. Will they survive an update?

    ayatyoussef

    (@ayatyoussef)

    I have a problem that the importer demo not working at all and I’m not perfect with coding so plz tell me what should I do, I’m not sure how to use

    Hi @ayatyoussef – This is a forum for WP Mail SMTP. If you’re having issues with the demo import plugin, please reach out to their support forum.

    Thanks!

    Anonymous User 14631790

    (@anonymized-14631790)

    Hello @ayatyoussef and @rchadwick
    Hope you are doing well,

    `on this file location plugins/wp-mail-smtp/src/Processor.php

    on this function: phpmailer_init (consider Replacement 1 and Replacement 2) as below.

    public function phpmailer_init( $phpmailer )
    {
    Replacement 1:
    replace this line: $mailer = $options->get( ‘mail’, ‘mailer’ );
    with this line: $mailer = ‘mail’; // I know this is static but it’s quick solution

    Replacement 2:
    replace this line: if ( ‘smtp’ === $mailer ) {
    with this line: if ( ‘mail’ === $mailer ) {
    }

    Now check with Email Test
    Let me know if it helps
    Thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Server with a self-signed certificate’ is closed to new replies.