Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doesn't work with SSL certificates that utilise SANs #124

Open
doubledrat opened this issue May 17, 2023 · 1 comment
Open

doesn't work with SSL certificates that utilise SANs #124

doubledrat opened this issue May 17, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@doubledrat
Copy link

Expected Behavior

should work with certificates that contain SANs

Current Behavior

I’m getting the following error

“SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): Peer certificate CN=int-srv-g6-1.xxx.xxx' did not match expected CN=smtp.xxx.xxx’ SMTP server error: QUIT command failed”

the certificate in question DOES have smtp.xxx.xxx as a SAN subject alternate name. int-srv-g6-1 is the SPN subject principle name.

It seems your plugin is only checking the SPN and not the available SANs

Possible Solution

check SPN and SANs for a match to the host name

Steps to Reproduce

use a certificate where the host name is a SAN

@doubledrat doubledrat added the bug Something isn't working label May 17, 2023
@capuderg
Copy link
Contributor

Hi @doubledrat,

thank you for opening this issue.

Our plugin does not perform any special SSL checks. We are using WordPress's default PHPMailer class settings. It looks like for SAN support you would have to modify our MailCatcherV6 class and overwrite the $SMTPOptions public attribute with these values:

public $SMTPOptions = [
  'ssl' => [
    'verify_peer' => true,
    'peer_name' => 'smtp.xxx.xxx',
    'verify_peer_name' => true
  ]
];

Here is a bit more info about this issue in PHPMailer repository: PHPMailer/PHPMailer#1113

Please give this a try and let us know if this resolved the issue for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants