ejabberd tls client

Hello everybody,

I have been facing problem while sending data over newly upgraded TLS connection(from tls connection).
For that, on TLS client side, I am using tls module for upgrading tcp to tls.
The code fragment is as below

case tls:tcp_to_tls(StateData#state.socket, [{certfile, "./cert-key.pem"}, connect]) of
   {ok, TLSSocket}->
        io:format("Migrated to tls~n"),
        io:format("xmpp: TLSocket:~w~n", [TLSSocket]),
        xml_stream:close(StateData#state.xml_stream),
        NewStreamState = xml_stream:new(self()),
        {next_state, ready_to_connect, StateData#state{socket = TLSSocket, xml_stream = NewStreamState1}};
   _->
        io:format("Couldn't migrate to tls~n"),
        {next_state, ready_to_connect, StateData}
   end

But, while sending data over newly created TLSSocket, it's just hanging.
What can be the reason for not being able to send data over upgraded TLSSocket ?

Syndicate content