Resource icon

How to use self signed certs for SSL/TLS IMAP and SMTP.

bottiger

Active member
bottiger submitted a new resource:

How to use self signed certs for SSL/TLS IMAP and SMTP. - How to disable certificate/peer verification for IMAP and SMTP so you can use a self-signed cert

If you have an SMTP or IMAP server that has a self signed certifcate, you will need this option to make Xenforo work with it. It just needs 2 file edits.


src/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php

paste this after
PHP:
$options = [];

PHP:
$options['ssl']['verify_peer'] = FALSE;
$options['ssl']['verify_peer_name'] = FALSE;



Edit
src/vendor/laminas/laminas-mail/src/Protocol/Imap.php

replace this...

Read more about this resource...
 
Hi you comments on my other post.
i did what it aid but now the error says
  • Failed to authenticate on SMTP server with username "email removed for post" using 2 possible authenticatorsScreenshot 2021-06-15 001838.webp
 
You have another error in your email configuration that is unrelated to peer verification then.
There is no other error, as a test i turned off the smtp restriction from whm and emails started working that means the problem is this"
this proves that there is no other problem

SMTP Error - stream_socket_enable_crypto(): Peer certificate CN did not match expected CN"​

The code which is in the guide is already placed on my website and it gives me the error- Failed to authenticate on SMTP server with username "email removed for post" using 2 possible authenticators


 
Please let me know if the code is correct, i placed what you said in the guide

i have added 2 screenshots . please check and let me know


1623736482497.webp
1623736251175.webp
 
If it says something about the peer certificate being bad, then your change didn't go through. You either edited the wrong copy of the files or you have an opcode cache on the old code.
 
Back
Top Bottom