[asterisk-bugs] [JIRA] (ASTERISK-28949) res_http_websocket: Add masking to websocket client

Friendly Automation (JIRA) noreply at issues.asterisk.org
Mon Jun 22 08:27:25 CDT 2020


    [ https://issues.asterisk.org/jira/browse/ASTERISK-28949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=251188#comment-251188 ] 

Friendly Automation commented on ASTERISK-28949:
------------------------------------------------

Change 14520 merged by Friendly Automation:
res_http_websocket: Add payload masking to the websocket client

[https://gerrit.asterisk.org/c/asterisk/+/14520|https://gerrit.asterisk.org/c/asterisk/+/14520]

> res_http_websocket: Add masking to websocket client
> ---------------------------------------------------
>
>                 Key: ASTERISK-28949
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28949
>             Project: Asterisk
>          Issue Type: Improvement
>      Security Level: None
>          Components: Resources/res_http_websocket
>    Affects Versions: GIT
>            Reporter: Moises Silva
>            Assignee: Moises Silva
>
> The websocket client API is not performing masking. The websocket RFC 6455 mandates all frame data sent by a client to be masked (MUST).
> Asterisk currently doesn't seem to use the client API at all anywhere, except for the purpose of testing the server implementation. The current server implementation does not follow RFC 6455 strictly and allows a client to send data that is not masked, instead of closing the connection as it's specified in the RFC. Not sure if you'd like to fix that, it's a simple enough check but I did not add it as it could cause broken clients out there relying on this loose behaviour.
> I only found this because I'm writing a dialplan app that creates an outbound websocket connection to an upstream server and it did not work because the server closed the connection immediately with a protocol error (you can try with node.js wscat for example).
> I've written a patch to fix this. I'll post the git branch next. Unfortunately in master the websocket tests were failing for me, even without my patch. I was aiming to write a test for a few masking scenarios (different payload sizes) but ran out of time for now. I'll see if I can add some during the week.
> Admittedly, this improvement does not benefit anyone at the moment, but it may save time someone in the future trying to use the websocket client api.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list