Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
73e9bd4d
Kaydet (Commit)
73e9bd4d
authored
Kas 11, 2012
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #16357: fix calling accept() on a SSLSocket created through SSLContext.wrap_socket().
Original patch by Jeff McNeil.
üst
6d9388fa
5c89b4ec
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
10 deletions
+44
-10
ssl.py
Lib/ssl.py
+5
-10
test_ssl.py
Lib/test/test_ssl.py
+36
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/ssl.py
Dosyayı görüntüle @
73e9bd4d
...
@@ -553,16 +553,11 @@ class SSLSocket(socket):
...
@@ -553,16 +553,11 @@ class SSLSocket(socket):
SSL channel, and the address of the remote client."""
SSL channel, and the address of the remote client."""
newsock
,
addr
=
socket
.
accept
(
self
)
newsock
,
addr
=
socket
.
accept
(
self
)
return
(
SSLSocket
(
sock
=
newsock
,
newsock
=
self
.
context
.
wrap_socket
(
newsock
,
keyfile
=
self
.
keyfile
,
certfile
=
self
.
certfile
,
do_handshake_on_connect
=
self
.
do_handshake_on_connect
,
server_side
=
True
,
suppress_ragged_eofs
=
self
.
suppress_ragged_eofs
,
cert_reqs
=
self
.
cert_reqs
,
server_side
=
True
)
ssl_version
=
self
.
ssl_version
,
return
newsock
,
addr
ca_certs
=
self
.
ca_certs
,
ciphers
=
self
.
ciphers
,
do_handshake_on_connect
=
self
.
do_handshake_on_connect
),
addr
)
def
get_channel_binding
(
self
,
cb_type
=
"tls-unique"
):
def
get_channel_binding
(
self
,
cb_type
=
"tls-unique"
):
"""Get channel binding data for current connection. Raise ValueError
"""Get channel binding data for current connection. Raise ValueError
...
...
Lib/test/test_ssl.py
Dosyayı görüntüle @
73e9bd4d
...
@@ -1796,6 +1796,42 @@ else:
...
@@ -1796,6 +1796,42 @@ else:
t
.
join
()
t
.
join
()
server
.
close
()
server
.
close
()
def
test_server_accept
(
self
):
# Issue #16357: accept() on a SSLSocket created through
# SSLContext.wrap_socket().
context
=
ssl
.
SSLContext
(
ssl
.
PROTOCOL_SSLv23
)
context
.
verify_mode
=
ssl
.
CERT_REQUIRED
context
.
load_verify_locations
(
CERTFILE
)
context
.
load_cert_chain
(
CERTFILE
)
server
=
socket
.
socket
(
socket
.
AF_INET
)
host
=
"127.0.0.1"
port
=
support
.
bind_port
(
server
)
server
=
context
.
wrap_socket
(
server
,
server_side
=
True
)
evt
=
threading
.
Event
()
remote
=
None
peer
=
None
def
serve
():
nonlocal
remote
,
peer
server
.
listen
(
5
)
# Block on the accept and wait on the connection to close.
evt
.
set
()
remote
,
peer
=
server
.
accept
()
remote
.
recv
(
1
)
t
=
threading
.
Thread
(
target
=
serve
)
t
.
start
()
# Client wait until server setup and perform a connect.
evt
.
wait
()
client
=
context
.
wrap_socket
(
socket
.
socket
())
client
.
connect
((
host
,
port
))
client_addr
=
client
.
getsockname
()
client
.
close
()
t
.
join
()
# Sanity checks.
self
.
assertIsInstance
(
remote
,
ssl
.
SSLSocket
)
self
.
assertEqual
(
peer
,
client_addr
)
def
test_default_ciphers
(
self
):
def
test_default_ciphers
(
self
):
context
=
ssl
.
SSLContext
(
ssl
.
PROTOCOL_SSLv23
)
context
=
ssl
.
SSLContext
(
ssl
.
PROTOCOL_SSLv23
)
try
:
try
:
...
...
Misc/NEWS
Dosyayı görüntüle @
73e9bd4d
...
@@ -80,6 +80,9 @@ Core and Builtins
...
@@ -80,6 +80,9 @@ Core and Builtins
Library
Library
-------
-------
-
Issue
#
16357
:
fix
calling
accept
()
on
a
SSLSocket
created
through
SSLContext
.
wrap_socket
().
Original
patch
by
Jeff
McNeil
.
-
Issue
#
16409
:
The
reporthook
callback
made
by
the
legacy
-
Issue
#
16409
:
The
reporthook
callback
made
by
the
legacy
urllib
.
request
.
urlretrieve
API
now
properly
supplies
a
constant
non
-
zero
urllib
.
request
.
urlretrieve
API
now
properly
supplies
a
constant
non
-
zero
block_size
as
it
did
in
Python
3.2
and
2.7
.
This
matches
the
behavior
of
block_size
as
it
did
in
Python
3.2
and
2.7
.
This
matches
the
behavior
of
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment