Hi,
Platform Details
SoC: Toradex i.MX6QDL (custom carrier board)
Module: GSM modem (PPP-based connectivity)
OS: Linux 4.14.170 (Yocto-based)
OpenSSL: 1.1.1g
Connectivity: PPP over cellular (M2M SIM)
Problem Summary
On the embedded device, basic network connectivity is functioning correctly:
-
ICMP works (ping 8.8.8.8, google.com)
-
DNS resolution works
However, HTTPS/TLS connections consistently fail with the following error:
write:errno=104 (Connection reset by peer)
SSL handshake has read 0 bytes
This issue occurs when connecting to Amazon Web Services S3 endpoints as well as general HTTPS servers (e.g., Google). The same commands work without any issues when executed from a standard PC on a regular network.
Observed Behavior
- Standard TLS connection (fails)
Command:
openssl s_client -connect google.com:443 -servername google.com
Result:
-
TCP connection is established
-
TLS ClientHello is sent
-
Immediate TCP reset (RST) is received
-
No ServerHello response
-
AWS/S3 access (fails)
HTTPS downloads from S3 using wget fail with:
Connection reset by peer -
TLS without SNI (works)
After applying:
sysctl -w net.ipv4.route.min_adv_mss=1200
sysctl -w net.ipv4.tcp_base_mss=1200
Command:
openssl s_client -connect <S3_IP>:443 -noservername
Result:
-
TLS handshake completes successfully
-
Valid S3 certificate is received
-
HTTP response is returned (400 expected due to missing Host header)
- Python workaround (SNI disabled)
Disabling SNI in the TLS handshake allows successful downloads. This confirms that the TLS stack is functioning correctly and suggests the issue is at the network level.
Test Matrix
IP:443 (no SNI) → Success
IP:443 (with SNI = *.amazonaws.com) → Connection reset
s3.amazonaws.com:443 → Connection reset
s3.ap-south-1.amazonaws.com:443 → Connection reset
Key Observation
TLS ClientHello packets containing the SNI extension trigger an immediate TCP reset, while TLS connections without SNI succeed. This indicates possible Deep Packet Inspection (DPI) or carrier/network-level filtering.
We wanted to understand the following:
-
Why does this issue occur specifically on the embedded device using the M2M SIM? We also tested with a different custom board and a regular SIM card and observed the same behavior.
-
Is there a recommended or supported approach to resolve this issue without disabling SNI, since disabling SNI is not a viable long-term solution?
Thanks,
Adnan