Skip to content

OpenSSL error when trying to establish a connection #581

Closed
@ben1985614

Description

@ben1985614

Hello,

We see the following error in the PHP log during establishing a connection:

[22-May-2025 13:35:03 Europe/Berlin] PHP Warning:  stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
error:0A00010B:SSL routines::wrong version number in C:\phpimap\vendor\webklex\php-imap\src\Connection\Protocols\Protocol.php on line 244
[22-May-2025 13:35:03 Europe/Berlin] PHP Warning:  stream_socket_client(): Failed to enable crypto in C:\phpimap\vendor\webklex\php-imap\src\Connection\Protocols\Protocol.php on line 244
[22-May-2025 13:35:03 Europe/Berlin] PHP Warning:  stream_socket_client(): Unable to connect to tls://xxxxxx.goserver.host:587 (Unknown error) in C:\phpimap\vendor\webklex\php-imap\src\Connection\Protocols\Protocol.php on line 244

Here is our PHP code:

$imapClientManager = new ClientManager($options = []);
$imapClient = $imapClientManager->account('xxxxxxxx');

$vpIMAPClient = $imapClientManager->make([
	'host'          => 'xxxxxx.goserver.host',
	'port'          => 587,
	'encryption'    => 'tls',
	'validate_cert' => false,
	'username'      => '[email protected]',
	'password'      => 'xxxxxxx',
	'protocol'      => 'imap'
]);

try {
	$imapClient->connect();
} catch (Exception $e) {
	print_r($e);
}

We're using OpenSSL 3.5.0.

Can you please tell us what's causing this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions