mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.9] gh-121227: Disallow setting an empty list for NPN (GH-137161)
This commit is contained in:
parent
312de66fb5
commit
a2cdbb6e81
3 changed files with 10 additions and 0 deletions
|
|
@ -520,6 +520,8 @@ def wrap_bio(self, incoming, outgoing, server_side=False,
|
|||
|
||||
def set_npn_protocols(self, npn_protocols):
|
||||
protos = bytearray()
|
||||
if not npn_protocols:
|
||||
raise SSLError('NPN protocols must not be empty')
|
||||
for protocol in npn_protocols:
|
||||
b = bytes(protocol, 'ascii')
|
||||
if len(b) == 0 or len(b) > 255:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue