gnutls-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GnuTLS recv error (-9): A TLS packet with unexpected length was rece


From: Nikos Mavrogiannopoulos
Subject: Re: GnuTLS recv error (-9): A TLS packet with unexpected length was received. - with Paypal Website Payment Pro
Date: Mon, 07 Feb 2011 17:12:30 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7

On 02/03/2011 02:40 PM, Dan Winship wrote:
> On 02/03/2011 07:21 AM, Nikos Mavrogiannopoulos wrote:
>> Would having a special error code on this issue, such as 
>> GNUTLS_E_PREMATURE_TERMINATION make things better for
>> applications?
> Yes, although that should be part of the ABI break you were talking 
> about so it doesn't break people who expect to see 
> GNUTLS_E_UNEXPECTED_PACKET_LENGTH for that now.

The master branch (what will become 3.0.0), now distinguishes
the EOF error from other parsing errors.

> Another case that currently gets "unexpected packet length" is if
> you try to handshake with a peer that's not actually speaking TLS. It
> seems like it wouldn't be hard for gnutls to notice that and return 
> "GNUTLS_E_NOT_TLS" or something in that case. (It only needs to do
> it for the first packet received on the first handshake attempt.)
> This would let things like "gnutls-cli -p 80 www.gnutls.org" (and
> equivalent higher-level actions) fail with a better error message.

Actually this uncovered an error message that was not returned. The
error should have been GNUTLS_E_UNEXPECTED_PACKET. gnutls cannot
possibly distinguish between TLS and non-TLS data. It expects TLS data
and if they are not given it will return the parsing error occurred.
It is up to you to make the deduction that this is actually
non-TLS.

regards,
Nikos



reply via email to

[Prev in Thread] Current Thread [Next in Thread]