saltstack / saltstack/salt

[BUG] TCP transport SSL error

Open
#62,421 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
When using SSL with the TLS transport we may run into this exception:

2022-05-05 12:16:04,536 [tornado.general  :555 ][ERROR   ][777326] Uncaught exception, closing connection: ('REDACTED', 54603)
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/salt/ext/tornado/iostream.py", line 520, in _handle_events
self._handle_read()
File "/usr/lib/python3.6/site-packages/salt/ext/tornado/iostream.py", line 1396, in _handle_read
self._do_ssl_handshake()
File "/usr/lib/python3.6/site-packages/salt/ext/tornado/iostream.py", line 1316, in _do_ssl_handshake
self.socket.do_handshake()
File "/usr/lib64/python3.6/ssl.py", line 1036, in do_handshake
self._sslobj.do_handshake()
File "/usr/lib64/python3.6/ssl.py", line 648, in do_handshake
self._sslobj.do_handshake()
OSError: [Errno 0] Error

Setup

master config

## salt-master config

interface: 0.0.0.0
hash_type: sha256
keep_jobs: 1
file_recv: True
file_recv_max_size: 100

transport: tcp
ssl:
  keyfile: /etc/salt/pki/master/tls.key
  certfile: /etc/salt/pki/master/tls.crt
  ssl_version: PROTOCOL_TLS

presence_events: True

pillar_cache: True
cachedir: /opt/salt/cache/master
grains_cache: True
grains_cache_expiration: 3600

minion config

master: 
  - REDACTED
hash_type: sha256
transport: tcp
ssl: True
log_granular_levels: {'salt.transport.tcp': 'error'}

Looks like this was resolved in a more recent version of tornado.

https://github.com/tornadoweb/tornado/pull/2518/files#diff-15c0dbe9be844d2630a4a3fc39215fcbb1734d09ff8c379b0cdb951c82ad989b

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading salt/ext/tornado/iostream.py around _do_ssl_handshake and compare the linked Tornado pull request. Reproduce the OSError with the TCP/SSL setup; done means the issue is confirmed resolved or a focused fix is identified and covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.