On the server side the keys are issued in this order:
Handshake write: Immediately after write of ServerHello
Handshake read: Immediately after above
Application write: Immediate after write of Server Finished
Application read: Immediately after read of Client Finished
On the client side the keys have this order:
Handshake read: Immediately after read of ServerHello
Handshake write: Immediately after above
Application read: Immediately after read of Server Finished
Application write: Immediately after write of Client Finished
See this comment and this comment for potential issues this may cause.
We should investigate whether we have a bug here, and whether we should swap the order that the keys are issued on the client side.
On the server side the keys are issued in this order:
Handshake write: Immediately after write of ServerHello
Handshake read: Immediately after above
Application write: Immediate after write of Server Finished
Application read: Immediately after read of Client Finished
On the client side the keys have this order:
Handshake read: Immediately after read of ServerHello
Handshake write: Immediately after above
Application read: Immediately after read of Server Finished
Application write: Immediately after write of Client Finished
See this comment and this comment for potential issues this may cause.
We should investigate whether we have a bug here, and whether we should swap the order that the keys are issued on the client side.