wormling / phparia

Framework for creating ARI (Asterisk REST Interface) applications.
http://phparia.org
Apache License 2.0
39 stars 35 forks source link

No Issue: Request / wss Ports #12

Closed Teumel closed 8 years ago

Teumel commented 8 years ago

Hi Brian,

First: Great work with this package! Thank you very much for sharing this.

My question: Is there a chance to force the AriClient to connect to a asterisk wss:\ - port?

I am not really sure what would be the best way to change/forward the curl_opts to include certifcates/SSL-specific options for a secure connection.

My problem is that asterisk and the php - stasis - application based on phparia are not running on the same machine and I would like to secure the communication between these two nodes.

Thank you very much Best Regards Joerg

wormling commented 8 years ago

I looked and it seems to be possible with wss://... but I'm not sure that PESTJson will do the job properly (plus there is a hard-coded http:// that needs to be changed). I have been thinking of switching to guzzle though. If I get a chance to add a certificate at wormlling.org for testing this, I'll let you know. If you have some time I could help you get this in there.

Teumel commented 8 years ago

Thanks for looking into this. Guzzle sounds very good as an alternative for PEST. Because I am working on a bigger project, which will run longer to be finished and in which this secure connection is not THAT mandatory, it is not such a hurry .I think I'll find a way to accomplish this with your current state of phparia/PEST (i.e. fork) if it would be necessary. I would be more than happy if I can support you with testing/contributing if you want to switch to guzzle. Please excuse my bad English skills.

wormling commented 8 years ago

Check out the 3.0 branch. It uses guzzle now and worked with wss/https for me. I pretty much did search/replace and ran the tests though, so don't expect it to be super stable.

Teumel commented 8 years ago

Man, your are so fast. Works pretty good. Just two small code changes on my side (switching the Server Exception to GuzzleHttp\Exception\ServerException + adjusting the client-connect with ssl params). And boom: Works ;-) Thank you so much for this branch. I will let you know if we will facing issues with the guzzle-basis.Thumbs up and thanks again!!!

wormling commented 8 years ago

Thanks. Warning on the 3.0 branch. There are some breaking changes that I want to add such as changing getChannels() to getChannelIds() as well as method signatures (They're getting too long and Digium keeps changing the parameters). Any breaking changes will be posted in the UPGRADE document.

Teumel commented 8 years ago

Got that, I will have an eye on the Uprgrade Document.