[sip-comm-dev] MORE ABOUT THE TLS BUG's SOLUTION


#1

Hi!

I've found there is more wrong code about the TLS SIP.

package net.java.sip.communicator.impl.protocol.sip;

public class ProtocolProviderServiceSipImpl

private void initOutboundProxy(AccountID accountID, Hashtable
jainSipProperties)

Line 1692:

Changing:

//proxy transport
        String proxyTransport = (String) accountID.getAccountProperties()
            .get(ProtocolProviderFactory.PROXY_TRANSPORT);

        if (proxyTransport != null && proxyTransport.length() > 0)
        {
            if (!proxyTransport.equals(ListeningPoint.UDP)
                >> !proxyTransport.equals(ListeningPoint.TCP)
                >> !proxyTransport.equals(ListeningPoint.TLS))
            {
                throw new IllegalArgumentException(proxyTransport
                    + " is not a valid transport protocol. Transport must be
"
                    + "left blanc or set to TCP, UDP or TLS.");
            }
        }
        else
        {
            proxyTransport = ListeningPoint.UDP;
        }

For:

//proxy transport

        String proxyTransport = (String) accountID.getAccountProperties()

            .get(ProtocolProviderFactory.PREFERRED_TRANSPORT);

        if (proxyTransport != null && proxyTransport.length() > 0)

        {

            if (!proxyTransport.equals(ListeningPoint.UDP)

                && !proxyTransport.equals(ListeningPoint.TCP)

                && !proxyTransport.equals(ListeningPoint.TLS))

            {

                throw new IllegalArgumentException(proxyTransport

                    + " is not a valid transport protocol. Transport must be
"

                    + "left blanc or set to TCP, UDP or TLS.");

            }

        }

        else

        {

            proxyTransport = ListeningPoint.UDP;

        }

This bug is driving me crazy. Is there another similar transport tests like
that in the code??

Regards, Pablo L.


#2

Good catch once again Pablo!

I've just committed.

Thanks
Emil

Pablo wrote:

···

Hi!

I�ve found there is more wrong code about the TLS SIP.

package net.java.sip.communicator.impl.protocol.sip;

public class ProtocolProviderServiceSipImpl

private void initOutboundProxy(AccountID accountID, Hashtable jainSipProperties)

Line 1692:

Changing:

//proxy transport

        String proxyTransport = (String) accountID.getAccountProperties()

            .get(ProtocolProviderFactory.PROXY_TRANSPORT);

        if (proxyTransport != null && proxyTransport.length() > 0)

        {

            if (!proxyTransport.equals(ListeningPoint.UDP)

                >> !proxyTransport.equals(ListeningPoint.TCP)

                >> !proxyTransport.equals(ListeningPoint.TLS))

            {

                throw new IllegalArgumentException(proxyTransport

                    + " is not a valid transport protocol. Transport must be "

                    + "left blanc or set to TCP, UDP or TLS.");

            }

        }

        else

        {

            proxyTransport = ListeningPoint.UDP;

        }

For:

//proxy transport

        String proxyTransport = (String) accountID.getAccountProperties()

            .get(ProtocolProviderFactory.PREFERRED_TRANSPORT);

        if (proxyTransport != null && proxyTransport.length() > 0)

        {

            if (!proxyTransport.equals(ListeningPoint.UDP)

                && !proxyTransport.equals(ListeningPoint.TCP)

                && !proxyTransport.equals(ListeningPoint.TLS))

            {

                throw new IllegalArgumentException(proxyTransport

                    + " is not a valid transport protocol. Transport must be "

                    + "left blanc or set to TCP, UDP or TLS.");

            }

        }

        else

        {

            proxyTransport = ListeningPoint.UDP;

        }

This bug is driving me crazy. Is there another similar transport tests like that in the code??

Regards, Pablo L.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

Romain just made me notice that my previous commit was incomplete. I've now committed the rest of it.

Emil

Emil Ivov wrote:

···

Good catch once again Pablo!

I've just committed.

Thanks
Emil

Pablo wrote:

Hi!

I�ve found there is more wrong code about the TLS SIP.

package net.java.sip.communicator.impl.protocol.sip;

public class ProtocolProviderServiceSipImpl

private void initOutboundProxy(AccountID accountID, Hashtable jainSipProperties)

Line 1692:

Changing:

//proxy transport

        String proxyTransport = (String) accountID.getAccountProperties()

            .get(ProtocolProviderFactory.PROXY_TRANSPORT);

        if (proxyTransport != null && proxyTransport.length() > 0)

        {

            if (!proxyTransport.equals(ListeningPoint.UDP)

                >> !proxyTransport.equals(ListeningPoint.TCP)

                >> !proxyTransport.equals(ListeningPoint.TLS))

            {

                throw new IllegalArgumentException(proxyTransport

                    + " is not a valid transport protocol. Transport must be "

                    + "left blanc or set to TCP, UDP or TLS.");

            }

        }

        else

        {

            proxyTransport = ListeningPoint.UDP;

        }

For:

//proxy transport

        String proxyTransport = (String) accountID.getAccountProperties()

            .get(ProtocolProviderFactory.PREFERRED_TRANSPORT);

        if (proxyTransport != null && proxyTransport.length() > 0)

        {

            if (!proxyTransport.equals(ListeningPoint.UDP)

                && !proxyTransport.equals(ListeningPoint.TCP)

                && !proxyTransport.equals(ListeningPoint.TLS))

            {

                throw new IllegalArgumentException(proxyTransport

                    + " is not a valid transport protocol. Transport must be "

                    + "left blanc or set to TCP, UDP or TLS.");

            }

        }

        else

        {

            proxyTransport = ListeningPoint.UDP;

        }

This bug is driving me crazy. Is there another similar transport tests like that in the code??

Regards, Pablo L.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net