xmppo / xmpp-php

PHP client library for XMPP (Jabber) protocol
https://github.com/xmppo/xmpp-php
MIT License
45 stars 22 forks source link

Added SSL context support and minor fixes #17

Open WelterRocks opened 4 years ago

WelterRocks commented 4 years ago

Added support for SSL context to bypass verify_peer and verify_host and allow self signed certificates. Added support for realms on supporting servers. Fixed timestamps in logger.

Norgul commented 4 years ago

Thank you for the PR, I have few questions.

  1. What is the purpose of realm? The way I see it, it is same as host. String which can be set through options, and is used for connecting. So basically the same thing.
  2. Do credentials still work if you don't provide authzid?
  3. In Socket you are setting context options to your new methods, but they don't seem to have any defaults. What if you don't set them?

Thanks

WelterRocks commented 4 years ago

Authzid is used for many xmpp installations and ldap based auth mechanisms. Yes, credentials still work without authzid, i have tested this against some servers with different configurations, yesterday.

Also, there are many servers out there, which have a specified hostname to connect to (with there corresponding SRV entries in DNS), but need other domains AFTER connect. Ecovacs API server for example is such a candidate for example, but there are many others (like iot combox) working the same way. Therefore a split of connection hostname and auth domain ist required, which is done by setting a "realm".

My project EcoPhacs makes use of these implementations for example, which are required to connect to their xmpp servers. If you would like to see, how this works, feel free to look at the code.

Last, the socket defaults. The defaults are defined in PHP, therefore a seperate specification is not needed. The default behaviour is the same, like before the modification is done. So, if you do not use or set authzid or socket context, xmpp-php behaves the same way, like before the modifications were placed in the code. So if you dont use the modifications, you will not notice that there are changes in the code.

Norgul commented 3 years ago

Regarding sockets and authzid, great!

Regarding realm...I still see no point because the way I see it from code, it looks as if it is different from host only with naming. It is used in same places as host and it is used the same way as host.