(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->SMTPConnect, true, STREAM_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.