Skip to content
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.

stream_socket_enable_crypto(): SSL: Success #87

Open
kamrava opened this issue Sep 10, 2019 · 1 comment
Open

stream_socket_enable_crypto(): SSL: Success #87

kamrava opened this issue Sep 10, 2019 · 1 comment

Comments

@kamrava
Copy link

kamrava commented Sep 10, 2019

I'm trying to connect to server on my localhost as below:

$address = 'tcp://localhost:5222';
$username = 'admin@localhost';
$password = 'admin';
$options = new Options($address);
$options->setUsername($username)
            ->setPassword($password)
            ->setTo('localhost')
            ->setContextOptions([
                'ssl' => [
                    'verify_peer' => false,
                    'verify_peer_name' => false,
                    'allow_self_signed' => true,

                ]
            ]);
$client = new Client($options);
$client->connect();

But it returns this error:

stream_socket_enable_crypto(): SSL: Success

@satoshinosekai
Copy link

Try

use Fabiang\Xmpp\Options;
use Fabiang\Xmpp\Client;
use Fabiang\Xmpp\Protocol\Roster;
use Fabiang\Xmpp\Protocol\Presence;
use Fabiang\Xmpp\Protocol\Message;

stream_context_set_default([
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
]
]);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants