Code Igniter 3 - SSL operation failed with code 1. OpenSSL Error messages: error:0A00010B:SSL routines::wrong version number

103 Views Asked by At

I've updated a server from PHP 5.6 and Code Igniter 2.5 to PHP 8.1 and Code Igniter 3

Everything seems to work except for the Email sending module.

The error says:

A PHP Error was encountered
Severity: Warning

Message: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:0A00010B:SSL routines::wrong version number

Filename: libraries/Email.php

Line Number: 2099

The email_debug shows that the TLS keeps failing in the CHUNKING part of the conversation

220-mail.our.server ESMTP Postfix
hello: 220 mail.our.server ESMTP Postfix
The following SMTP error was encountered: 220 mail.our.server ESMTP Postfix
starttls: 250-mail.our.server
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-DSN
250 CHUNKING
The following SMTP error was encountered: 250-mail.our.server 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-STARTTLS 250-ENHANCEDSTATUSCODES 250-8BITMIME 250-DSN 250 CHUNKING
The following SMTP error was encountered: .0.0 Ready to start TLS zvQ�O&"�qM5+��%��l�~ �~c=� �6�� !�����y�3n4���

Anyone? Any idea?

Checking;

Filename: libraries/Email.php

Line Number: 2099

In the specific library file I changed:

$crypto = stream_socket_enable_crypto($this->_smtp_connect, TRUE, $method);

to:

$crypto = stream_socket_enable_crypto($this->_smtp_connect, TRUE, STREAM_CRYPTO_METHOD_TLS_CLIENT);

But I keep getting the same error.

I also tried changing en /etc/php/8.1/cli/php.ini

;extension=openssl

to

extension=openssl

and

extension=php_openssl.dll

But has not worked, I keep getting the same error.

0

There are 0 best solutions below