Closed jrpikong closed 5 years ago
Sure, I will take a look and get back at you
It looks like Jabbim uses TLS which I didn't yet implement in the library. I will do that and inform you once done
Hello @jrpikong,
can you try out the new version 2.1.0
?
Along with your options just add setTls(true)
so that it looks like this
$options
->setHost(self::$host)
->setPort(self::$port)
->setUsername(self::$username)
->setPassword(self::$password)
->setTls(true);
@jrpikong I am closing the issue as the feature is implemented. Let me know if there is anything else needed. Thanks
Hi @Norgul I have new error if I try to use TLS
namespace Norgul\Xmpp;
class Example
{
protected static $host = 'jabbim.com';
protected static $port = 5222;
protected static $username = 'deny123@jabbim.com';
protected static $password = 'password213';
public static function go()
{
$options = new Options();
$options
->setHost(self::$host)
->setPort(self::$port)
->setUsername(self::$username)
->setPassword(self::$password)
->setUseTls(true);
$client = new XmppClient($options);
$client->connect();
$client->iq->getRoster();
$client->message->send('Hello world', 'smtel_001@jabbim.com');
// Uncomment if you want to manually enter raw XML (or call a function) and see a server response
// (new self)->sendRawXML($client);
do {
$response = $client->getResponse();
$client->prettyPrint($response);
} while (true);
$client->disconnect();
}
}
and This the response :
sniper@sniper:~/Projects/smtel/jabber$ php Example.php
PHP Warning: Module 'curl' already loaded in Unknown on line 0
PHP Warning: fwrite(): SSL operation failed with code 1. OpenSSL Error messages:
error:1420C0CF:SSL routines:ssl_write_internal:protocol is shutdown in /home/sniper/Projects/smtel/jabber/vendor/norgul/xmpp-php/src/Socket.php on line 53
Hello @jrpikong, which version are you using?
Response from server I'm getting is the following:
<failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>
<not-authorized/>
<text xml:lang='en'>Invalid username or password</text>
</failure>
Are you sure credentials are okay?
Btw, if you download the new version (v2.1.6
) you can get rid of setUseTls(true)
argument. TLS (if supported by server) is now enabled by default
Hi @Norgul I'm back, I use the last version . I can't connect with jabbim.com
` <?xml version="1.0" encoding="UTF-8"?>