Letractively / webrtcomm

Automatically exported from code.google.com/p/webrtcomm
GNU General Public License v3.0
0 stars 0 forks source link

Proper handling of 407 Proxy Authentication challenge for REGISTER #12

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Try to point a WebRTComm client to a server that responds with 407 to 
REGISTER
2. The client ignores 407

What is the expected output? What do you see instead?
The client should recognize 407 and respond with authentication

Here is the behavior before the patch:

 00:09:05,737 INFO  [gov.nist.javax.sip.stack.SIPTransactionStack] (SIP-TCP-Core-PipelineThreadpool-11) <message
from="127.0.0.1:56999" 
to="127.0.0.1:5082" 
time="1380085745737"
isSender="false" 
transactionId="z9hg4bk-383637-15e3ec0e0bb4b267bba30702fb914398" 
callId="1380085745716" 
firstLine="REGISTER sip:telestax.com SIP/2.0" 
>
<![CDATA[REGISTER sip:telestax.com SIP/2.0
Call-ID: 1380085745716
CSeq: 1 REGISTER
From: <sip:alice@telestax.com>;tag=1380085745726
To: <sip:alice@telestax.com>
Via: SIP/2.0/WS 
127.0.0.1:56999;branch=z9hG4bK-383637-15e3ec0e0bb4b267bba30702fb914398;rport=569
99;received=127.0.0.1
Max-Forwards: 70
User-Agent: TelScale RTM/1.0.0.Alpha3-SNAPSHOT
Expires: 3600
Allow: INVITE,ACK,CANCEL,BYE,OPTIONS,MESSAGE
Contact: <sip:alice@127.0.0.1:56999;transport=ws>
Content-Length: 0

]]>
</message>

00:09:05,738 INFO  
[org.mobicents.servlet.sip.core.dispatchers.InitialRequestDispatcher] 
(SIP-TCP-Core-PipelineThreadpool-11) Request event dispatched to RestComm
00:09:05,740 INFO  [gov.nist.javax.sip.stack.SIPTransactionStack] 
(RestComm-akka.actor.default-dispatcher-21) <message
from="127.0.0.1:5082" 
to="127.0.0.1:56999" 
time="1380085745740"
isSender="true" 
transactionId="z9hg4bk-383637-15e3ec0e0bb4b267bba30702fb914398" 
callId="1380085745716" 
firstLine="SIP/2.0 407 Proxy Authentication required" 
>
<![CDATA[SIP/2.0 407 Proxy Authentication required
To: 
<sip:alice@telestax.com>;tag=38686817_57a5b08a_5328dce8-ebc4-48f8-9c0e-dd29e056e
37f
Via: SIP/2.0/WS 
127.0.0.1:56999;branch=z9hG4bK-383637-15e3ec0e0bb4b267bba30702fb914398;rport=569
99;received=127.0.0.1
CSeq: 1 REGISTER
Call-ID: 1380085745716
From: <sip:alice@telestax.com>;tag=1380085745726
Proxy-Authenticate: Digest 
realm="telestax.com",nonce="39363665663135312d653665392d343"
Content-Length: 0

]]>
</message>

Here is the behavior after the patch:

00:18:32,530 INFO  [gov.nist.javax.sip.stack.SIPTransactionStack] 
(SIP-TCP-Core-PipelineThreadpool-16) <message
from="127.0.0.1:57063" 
to="127.0.0.1:5082" 
time="1380086312530"
isSender="false" 
transactionId="z9hg4bk-323132-049e27b59a2984da2bbe7e6bb1427052" 
callId="1380086312509" 
firstLine="REGISTER sip:telestax.com SIP/2.0" 
>
<![CDATA[REGISTER sip:telestax.com SIP/2.0
Call-ID: 1380086312509
CSeq: 1 REGISTER
From: <sip:alice@telestax.com>;tag=1380086312519
To: <sip:alice@telestax.com>
Via: SIP/2.0/WS 
127.0.0.1:57063;branch=z9hG4bK-323132-049e27b59a2984da2bbe7e6bb1427052;rport=570
63;received=127.0.0.1
Max-Forwards: 70
User-Agent: TelScale RTM/1.0.0.Alpha3-SNAPSHOT
Expires: 3600
Allow: INVITE,ACK,CANCEL,BYE,OPTIONS,MESSAGE
Contact: <sip:alice@127.0.0.1:57063;transport=ws>
Content-Length: 0

]]>
</message>

00:18:32,531 INFO  
[org.mobicents.servlet.sip.core.dispatchers.InitialRequestDispatcher] 
(SIP-TCP-Core-PipelineThreadpool-16) Request event dispatched to RestComm
00:18:32,532 INFO  [gov.nist.javax.sip.stack.SIPTransactionStack] 
(RestComm-akka.actor.default-dispatcher-50) <message
from="127.0.0.1:5082" 
to="127.0.0.1:57063" 
time="1380086312532"
isSender="true" 
transactionId="z9hg4bk-323132-049e27b59a2984da2bbe7e6bb1427052" 
callId="1380086312509" 
firstLine="SIP/2.0 407 Proxy Authentication required" 
>
<![CDATA[SIP/2.0 407 Proxy Authentication required
To: 
<sip:alice@telestax.com>;tag=31963822_57a5b08a_57b30596-ae02-4ed2-b366-4bc602129
957
Via: SIP/2.0/WS 
127.0.0.1:57063;branch=z9hG4bK-323132-049e27b59a2984da2bbe7e6bb1427052;rport=570
63;received=127.0.0.1
CSeq: 1 REGISTER
Call-ID: 1380086312509
From: <sip:alice@telestax.com>;tag=1380086312519
Proxy-Authenticate: Digest 
realm="telestax.com",nonce="32353166643037632d393165362d343"
Content-Length: 0

]]>
</message>

00:18:32,550 INFO  [gov.nist.javax.sip.stack.SIPTransactionStack] 
(SIP-TCP-Core-PipelineThreadpool-17) <message
from="127.0.0.1:57063" 
to="127.0.0.1:5082" 
time="1380086312550"
isSender="false" 
transactionId="z9hg4bk-323132-d77c7f856ae084ed728aac5ff7c01ad1" 
callId="1380086312509" 
firstLine="REGISTER sip:telestax.com SIP/2.0" 
>
<![CDATA[REGISTER sip:telestax.com SIP/2.0
CSeq: 2 REGISTER
User-Agent: TelScale RTM/1.0.0.Alpha3-SNAPSHOT
Expires: 3600
Allow: INVITE,ACK,CANCEL,BYE,OPTIONS,MESSAGE
Contact: <sip:alice@127.0.0.1:57063;transport=ws>
Call-ID: 1380086312509
Via: SIP/2.0/WS 
127.0.0.1:57063;branch=z9hG4bK-323132-d77c7f856ae084ed728aac5ff7c01ad1;rport=570
63;received=127.0.0.1
From: <sip:alice@telestax.com>;tag=1380086312519
To: <sip:alice@telestax.com>
Max-Forwards: 70
Proxy-Authorization: Digest 
username="alice",realm="telestax.com",nonce="32353166643037632d393165362d343",re
sponse="4e167b47de7e8ce6c53fdd10f2f5364c",uri="sip:telestax.com",algorithm=MD5
Content-Length: 0

]]>
</message>

00:18:32,551 INFO  
[org.mobicents.servlet.sip.core.dispatchers.InitialRequestDispatcher] 
(SIP-TCP-Core-PipelineThreadpool-17) Request event dispatched to RestComm
00:18:32,554 INFO  [stdout] (RestComm-akka.actor.default-dispatcher-52) [INFO] 
[09/25/2013 00:18:32.554] [RestComm-akka.actor.default-dispatcher-50] 
[akka://RestComm/user/$b] The user agent manager registered alice
00:18:32,555 INFO  [gov.nist.javax.sip.stack.SIPTransactionStack] 
(RestComm-akka.actor.default-dispatcher-50) <message
from="127.0.0.1:5082" 
to="127.0.0.1:57063" 
time="1380086312555"
isSender="true" 
transactionId="z9hg4bk-323132-d77c7f856ae084ed728aac5ff7c01ad1" 
callId="1380086312509" 
firstLine="SIP/2.0 200 OK" 
>
<![CDATA[SIP/2.0 200 OK
To: 
<sip:alice@telestax.com>;tag=52958437_57a5b08a_72472b4e-0d3a-445d-8126-f51d1ea1e
0ed
Via: SIP/2.0/WS 
127.0.0.1:57063;branch=z9hG4bK-323132-d77c7f856ae084ed728aac5ff7c01ad1;rport=570
63;received=127.0.0.1
CSeq: 2 REGISTER
Call-ID: 1380086312509
From: <sip:alice@telestax.com>;tag=1380086312519
Contact: <sip:alice@127.0.0.1:57063;transport=ws>;expires=3600
Content-Length: 0

]]>
</message>

Original issue reported on code.google.com by ivelin.a...@gmail.com on 25 Sep 2013 at 5:25

GoogleCodeExporter commented 8 years ago
This issue was closed by revision 6b718a5c5296.

Original comment by ivelin.a...@gmail.com on 25 Sep 2013 at 5:47

GoogleCodeExporter commented 8 years ago
Please review the code and merge in the main branch if appropriate.

Original comment by ivelin.a...@gmail.com on 25 Sep 2013 at 5:49

GoogleCodeExporter commented 8 years ago
Ivelin quick comment, line 820 has a bad copy paste

else if(statusCode==401 || statusCode==401 )

should be 

else if(statusCode==401 || statusCode==407 )

Original comment by jean.deruelle on 25 Sep 2013 at 8:38

GoogleCodeExporter commented 8 years ago
Hello Ivelin.
Merge done.
Laurent

Original comment by laurent.strullu.orange@gmail.com on 26 Sep 2013 at 9:55