# Rocky 8.5 GnuTLS: An unexpected TLS packet was received

**URL:** <https://forums.rockylinux.org/t/rocky-8-5-gnutls-an-unexpected-tls-packet-was-received/4756>\
**Category:** Rocky Linux Help & Support\
**Created:** [November 30, 2021, 9:22pm UTC](https://forums.rockylinux.org/t/rocky-8-5-gnutls-an-unexpected-tls-packet-was-received/4756 "2021-11-30T21:22:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vpatel](https://avatars.discourse-cdn.com/v4/letter/v/74df32/32.png) [@vpatel](https://forums.rockylinux.org/u/vpatel)\
**Post date:** [November 30, 2021, 9:22pm UTC](https://forums.rockylinux.org/t/rocky-8-5-gnutls-an-unexpected-tls-packet-was-received/4756/1 "2021-11-30T21:22:16Z")

</div>

Hello. I recently migrated from CentOS 8 to Rocky 8 (8.5) using the Rocky Linux migration script. The migration went smoothly. However a Perl app that allows file downloads using https (https is provided via stunnel launched via xinetd) has stopped working. The following error occurs:

$ wget [https://fqdn/file.tar](https://fqdn/file.tar)  
GnuTLS: An unexpected TLS packet was received.  
Unable to establish SSL connection.

There have been no changes to the server in terms of hostname, IP, SSL certs, or other configuration. Testing the SSL connection via openssl seems to indicate everything is well:

$ openssl s\_client -debug -connect fqdn:443  
…  
SSL handshake has read 5 bytes and written 325 bytes  
Verification: OK  
…  
Verify return code: 0 (ok)  
…

stunnel logs also don’t indicate any errors. I reinstalled Perl SSL modules but no effect. So not sure what may be going on. Any help/pointers would be appreciated.

Other relevant info:

$ cat /etc/redhat-release  
Rocky Linux release 8.5 (Green Obsidian)

$ dnf list installed | grep -i tls  
gnutls.x86\_64 3.6.16-4.el8 @baseos  
gnutls-dane.x86\_64 3.6.16-4.el8 @appstream  
gnutls-utils.x86\_64 3.6.16-4.el8 @appstream  
rsyslog-gnutls.x86\_64 8.2102.0-5.el8 @appstream

$ dnf list installed | grep -i ssl  
apr-util-openssl.x86\_64 1.6.1-6.el8.1 @appstream  
mod\_ssl.x86\_64 1:2.4.37-43.module+el8.5.0+714+5ec56ee8 @appstream  
openssl.x86\_64 1:1.1.1k-4.el8 @baseos  
openssl-devel.x86\_64 1:1.1.1k-4.el8 @baseos  
openssl-libs.x86\_64 1:1.1.1k-4.el8 @baseos  
openssl-pkcs11.x86\_64 0.4.10-2.el8 @baseos  
perl-IO-Socket-SSL.noarch 2.066-4.module+el8.4.0+512+d4f0fc54 @appstream  
perl-Net-SSLeay.x86\_64 1.88-1.module+el8.4.0+512+d4f0fc54 @appstream  
python3-pyOpenSSL.noarch 19.0.0-1.el8 @appstream  
xmlsec1-openssl.x86\_64 1.2.25-4.el8 @appstream

$ dnf list installed | grep -i stunnel  
stunnel.x86\_64 5.56-5.el8\_3 @baseos

---

<div class="post-metadata">

**Author:** ![SomervilleTom](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@SomervilleTom](https://forums.rockylinux.org/u/SomervilleTom)\
**Post date:** [October 5, 2022, 5:00pm UTC](https://forums.rockylinux.org/t/rocky-8-5-gnutls-an-unexpected-tls-packet-was-received/4756/2 "2022-10-05T17:00:03Z")

</div>

I’m getting this same error using RL v8.6.

Any guidance?

Here is what I’m seeing:

```auto
$ wget "https://tms.byron.zeetix.com:6060"
--2022-10-05 12:58:30-- https://tms.byron.zeetix.com:6060/
Resolving tms.byron.zeetix.com (tms.byron.zeetix.com)... 54.144.238.19
Connecting to tms.byron.zeetix.com (tms.byron.zeetix.com)|54.144.238.19|:6060... connected.
GnuTLS: An unexpected TLS packet was received.
Unable to establish SSL connection.

```

The port (6060) is open (according firewall-cmd) and has a listener. I see no indication from the listener (a nodejs service) that it’s receiving anything.

---

<div class="post-metadata">

**Author:** ![gerry666uk](https://avatars.discourse-cdn.com/v4/letter/g/dbc845/32.png) [@gerry666uk](https://forums.rockylinux.org/u/gerry666uk)\
**Post date:** [October 5, 2022, 8:28pm UTC](https://forums.rockylinux.org/t/rocky-8-5-gnutls-an-unexpected-tls-packet-was-received/4756/3 "2022-10-05T20:28:58Z")

</div>

Have you checked the TLS protocol version they are running at ‘[tms.byron.zeetix.com](http://tms.byron.zeetix.com)’?

---

<div class="post-metadata">

**Author:** ![SomervilleTom](https://avatars.discourse-cdn.com/v4/letter/s/8797f3/32.png) [@SomervilleTom](https://forums.rockylinux.org/u/SomervilleTom)\
**Post date:** [October 12, 2022, 6:41pm UTC](https://forums.rockylinux.org/t/rocky-8-5-gnutls-an-unexpected-tls-packet-was-received/4756/4 "2022-10-12T18:41:10Z")

</div>

My case turned out to be a “feature” of working in the AWS/EC2 ecosystem. I was attempting the “wget” on either the same machine or from my home machine connecting to an AWS/EC2 instance.

I’ve lost track of the intricacies (after I got it working). I’m under the (empirical) impression that AWS “elastic IP addresses” are not available for secure connections on the same Amazon “Virtual Private Cloud”. The IP address noted in the above example is a public address. One step towards getting that “wget” to work was editing /etc/hosts on the originating machine to bind domain name to the internal AWS/EC2 address assigned by Amazon.

One change worth noting is that I got this error while using a listener (on 6060) provided from a dated “sample” provided by “auth0”. I replaced that listener with one I built myself from “node express” that I know works and that I know how to debug.

My bottom line is I treat this complaint (“An unexpected TLS packet was received”) as my system’s way of telling me that I screwed up the connection configuration (IP address, ports, etc).

---

<div class="post-metadata">

**Author:** ![brian](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/brian/32/5777_2.png) [@brian](https://forums.rockylinux.org/u/brian)\
**Post date:** [August 25, 2023, 3:37am UTC](https://forums.rockylinux.org/t/rocky-8-5-gnutls-an-unexpected-tls-packet-was-received/4756/5 "2023-08-25T03:37:40Z")

</div>


