Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSS Connections? #132

Closed
richardardrichard opened this issue Sep 24, 2015 · 14 comments
Closed

WSS Connections? #132

richardardrichard opened this issue Sep 24, 2015 · 14 comments

Comments

@richardardrichard
Copy link

I'm trying to set up a websocket connection to an XMPP server, and can't seem to get it working with TLS no matter how many different configurations I try 馃樃! Running Tsung with TLS turned off on the XMPP server is working fine, and normal websocket client connections using TLS are also working fine. Does Tsung support wss connections? I can't seem to find this in the documentation, or online anywhere, and any help would be much appreciated.

@nniclausse
Copy link
Contributor

if you use websocket as a server type, then no, it's not yet supported.

@tisba
Copy link
Collaborator

tisba commented Jul 11, 2018

Hasn't this been resolved, @nniclausse? e.g ca0e101 looks like it would implement wss already 馃槙

@andrewvmail
Copy link
Contributor

i'm trying this too and can't get it to work. I'm confused now if it has been implemented or not yet?

@tisba
Copy link
Collaborator

tisba commented Aug 6, 2018

@andrewvmail, @richardardrichard can you share the test configuration XML you've tried so far? I'm personally not very familiar with XMPP but maybe this gives us some more hints where to look.

As mentioned before, ca0e101 implements websocket_ssl/wss as a transport (ca0e101#diff-75ee81b28a58d235f7fd38b27c752170).

@andrewvmail
Copy link
Contributor

hi @tisba here is my config i believe it connects to the server , i see from the server log that something its hitting its websocket endpoint. but its not doing the following xmpp protocol commands defined in the config

<?xml version="1.0"?>
<!DOCTYPE tsung SYSTEM '/usr/local/Cellar/tsung/1.7.0/share/tsung/tsung-1.0.dtd'>
<tsung loglevel='debug' dumptraffic='true' version='1.0'>
    <clients>
        <client host='localhost' use_controller_vm='true'/>
    </clients>
    <servers>
        <server host='dev-sfo1-loadbalancer-1.some-domain.com' port='5285' type='websocket_ssl'/>
    </servers>
    <load>
        <arrivalphase phase="1" duration="14400000" unit="minute">
            <users maxnumber="254" interarrival="0.001" unit="second"></users>
        </arrivalphase>
    </load>
    <options>
        <option type="ts_jabber" name="userid_max" value="0" />
        <option type="ts_jabber" name="random_from_fileid" value='userdb'/>
        <option type="ts_jabber" name="offline_from_fileid" value='userdb'/>
        <option type="ts_jabber" name="fileid_delimiter" value=";"/>
        <option name="file_server" id='userdb' value="/Users/andrew/projects/xmpp/load-test/users.csv"/>
        <option type='ts_jabber' name='domain' value='some-domain.com' />
        <option name="websocket_path" value='/ws-xmpp/' />
    </options>

    <sessions>

        <session probability="100" name="jabber-example" type="ts_jabber">
            <request> <jabber type="connect" ack="no_ack"></jabber> </request>

            <setdynvars sourcetype="file" fileid="userdb" delimiter=";" order="iter">
                <var name="username" />
                <var name="password" />
            </setdynvars>

            <request subst='true'>
                <jabber type="connect" ack="no_ack">
                    <xmpp_authenticate username="%%_username%%" passwd="%%_password%%"/>
                </jabber>
            </request>

            <thinktime value="2"></thinktime>

  
            <request> <jabber type="presence:initial" ack="no_ack"/> </request>
            <thinktime value="10"></thinktime>
            <transaction name="roster">
                <request> <jabber type="iq:roster:get" ack="local"></jabber></request>
            </transaction>
            <thinktime value="10"></thinktime>
            <transaction name="online">
                <request> <jabber type="chat" ack="no_ack" size="16" destination="online"></jabber> </request>
            </transaction>
            <thinktime value="10"></thinktime>
            <transaction name="offline">
                <request> <jabber type="chat" ack="no_ack" size="56" destination="offline"></jabber> </request>
            </transaction>
            <thinktime value="2"></thinktime>

            <thinktime value="1"/>

            <request subst="true">
                <jabber type="presence:initial" ack="no_ack"/>
            </request>

            <!-- <for from="1" to="100" incr="1" var="j">
                <request subst="true">
                    <jabber type="chat" ack="no_ack" size="500" destination="online"/>
                </request>
                <thinktime value="5"/>
            </for> -->

            <request subst="true">
                <jabber type="presence:final" ack="no_ack"/>
            </request>

            <transaction name="close">
                <request> <jabber type="close" ack="no_ack"></jabber> </request>
            </transaction>
        </session>
    </sessions>
</tsung>
** Reason for termination = 
** {badarg,
       [{ts_server_websocket_ssl,close,1,
            [{file,"src/tsung/ts_server_websocket_ssl.erl"},{line,167}]},
        {ts_client,finish_session,1,
            [{file,"src/tsung/ts_client.erl"},{line,924}]},
        {gen_fsm,terminate,7,[{file,"gen_fsm.erl"},{line,588}]},
        {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]}

@tisba
Copy link
Collaborator

tisba commented Aug 7, 2018

Hey @andrewvmail!

  1. What version of tsung are you running exactly?
  2. Is this all of the error message?

In 1.7.0 ts_server_websocket_ssl.erl line 167 points here https://github.com/processone/tsung/blob/v1.7.0/src/tsung/ts_server_websocket_ssl.erl#L167

I have a theory (Socket can be none), but I cannot really test this out as I don't have access to a XMPP over Websocket/TLS endpoint (and I also don't know much about XMPP). I have pushed a branch with a potential fix: https://github.com/processone/tsung/tree/fix-websocket-ssl-transport.

Could you give this a try?

git clone https://github.com/processone/tsung.git
cd tsung
git checkout fix-websocket-ssl-transport
./configure --prefix="/tmp/tsung"
make install

@andrewvmail
Copy link
Contributor

@tisba

I was using Tsung version 1.7.0
I think there is other error but i don't think thats related to this

But yeath, I make from your branch and that one works.

/tmp/tsung/bin/tsung -version
Tsung version 1.7.1_dev

i see two way comm between Tsung and the xmpp server

@tisba
Copy link
Collaborator

tisba commented Aug 8, 2018

Nice! I'll make a proper PR then so that we can get this into develop and maybe even the upcoming 1.8.0 release.

@andrewvmail
Copy link
Contributor

Im just testing this again I think the regular websocket connection stopped working with jabber.

@andrewvmail
Copy link
Contributor

Here is the error message using the develop branch

=ERROR REPORT==== 18-Sep-2018::13:48:21 ===
Error in process <0.15496.0> on node tsung_controller@localmobile with exit value:
{undef,[{websocket,get_handshake,["127.0.0.1","/ws-xmpp",[],"13",[]],[]},
        {ts_server_websocket,loop,1,
                             [{file,"src/tsung/ts_server_websocket.erl"},
                              {line,81}]}]}

@tisba
Copy link
Collaborator

tisba commented Feb 5, 2019

I don't think that this error is related. Did you change something else? You said a while ago that the fix did work for you.

@tisba
Copy link
Collaborator

tisba commented Apr 14, 2019

@andrewvmail please comment again if you are sure that this issue is caused by the change. As I said, I don't think that the error is caused by #325.

@andrewvmail
Copy link
Contributor

oh missed the first message, i dont remember now. let me try to build and try tsung with the xmpp server. iirc think i was able to poke the server to get it to handshake with the develop build but previously it wont event talk. Ill get back to you.

@andrewvmail
Copy link
Contributor

andrewvmail commented May 11, 2019

@tisba #349 will fix the mentioned

@tisba tisba modified the milestone: 1.8.0 May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants