Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send the first server flight in single record #506

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tlslite/tlsconnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2746,6 +2746,7 @@ def _serverTLS13Handshake(self, settings, clientHello, cipherSuite,
clientHello.session_id,
cipherSuite, extensions=sh_extensions)

self.sock.buffer_writes = True
msgs = []
msgs.append(serverHello)
if not self._ccs_sent and clientHello.session_id:
Expand Down Expand Up @@ -2896,6 +2897,9 @@ def _serverTLS13Handshake(self, settings, clientHello, cipherSuite,
for result in self._queue_flush():
yield result

self.sock.flush()
self.sock.buffer_writes = False

self._changeReadState()

# Master secret
Expand Down
3 changes: 0 additions & 3 deletions tlslite/tlsrecordlayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -902,14 +902,11 @@ def _sendError(self, alertDescription, errorStr=None):

def _sendMsgs(self, msgs):
# send messages together in a single TCP write
self.sock.buffer_writes = True
randomizeFirstBlock = True
for msg in msgs:
for result in self._sendMsg(msg, randomizeFirstBlock):
yield result
randomizeFirstBlock = True
self.sock.flush()
self.sock.buffer_writes = False

def _sendMsg(self, msg, randomizeFirstBlock=True, update_hashes=True):
"""Fragment and send message through socket"""
Expand Down
Loading