Welcome Guest, Not a member yet? Register   Sign In
SMTP Email
#4

(This post was last modified: 07-30-2020, 09:28 PM by tgix.)

(07-30-2020, 01:26 PM)Chroma Wrote: According to the PHP manual stream_socket_enable_crypto should support TSL1.2 Client, which should be OK for this.
I am running PHP 7.3, but could bump to 7.4 without any problems on the code side.

OK. I would say that CI4 is enabling TLS in the wrong way since it only enables TLS 1.0 with the call to stream_socket_enable_crypto() and passing STREAM_CRYPTO_METHOD_TLS_CLIENT.

If you installed CI4 using composer, I suggest you edit one of the files inside CI4, namely: <project_root>/vendor/codeigniter4/framework/system/Email/Email.php and change line 1880:

PHP Code:
$crypto stream_socket_enable_crypto($this->SMTPConnecttrueSTREAM_CRYPTO_METHOD_TLS_CLIENT); 

Into something more compatible, such as:

Code:
$crypto = stream_socket_enable_crypto($this->SMTPConnect, true, STREAM_CRYPTO_METHOD_ANY_CLIENT);

or (only enabling TLS 1.2):
Code:
$crypto = stream_socket_enable_crypto($this->SMTPConnect, true, STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT);

Changing the framework files are not recommended since an upgrade will overwrite your changes, but will at least a) get you going and b) allow a change to framework for an upcoming version.

If you are not comfortable creating a pull request (PR), let me know if the connection with your server works after modifying the line and I can submit a PR with this change.
Reply


Messages In This Thread
SMTP Email - by Chroma - 07-30-2020, 09:38 AM
RE: SMTP Email - by tgix - 07-30-2020, 12:39 PM
RE: SMTP Email - by Chroma - 07-30-2020, 01:26 PM
RE: SMTP Email - by tgix - 07-30-2020, 09:27 PM
RE: SMTP Email - by Chroma - 07-30-2020, 11:11 PM
RE: SMTP Email - by tgix - 07-31-2020, 12:43 AM
RE: SMTP Email - by Chroma - 08-09-2020, 01:40 AM
RE: SMTP Email - by tgix - 08-09-2020, 02:09 AM
RE: SMTP Email - by Chroma - 08-09-2020, 09:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB