Page 1 of 1

unexpected packet type - problem and workaround

Posted: Tue 30 Mar 2021 09:15
by tabu
There is a problem with a seUnexpectedPacketType Exception.

Code: Select all

procedure TClientHandshakeLayer.ReplyToMessage(Message: THandshakeMessage);
begin
...
    htHelloRequest:
      MakeClientRenegotiateMessage;
...
end;
htHelloRequest comes to MakeClientRenegotiateMessage, comes to MakeClientHelloMessage

Code: Select all

procedure TClientHandshakeLayer.MakeClientHelloMessage;
...
begin
  if  (FState <> htNothing) and (FState <> htFinished) and (FState <> htServerHello) then
    raise EscError.Create(seUnexpectedPacketType);

Comes always to seUnexpectedPacketType cause FState is in this path always htHelloRequest.

Replacing with

Code: Select all

//  if (FState <> htHelloRequest) and (FState <> htNothing) and (FState <> htFinished) and (FState <> htServerHello) then
  if not (FState in [htHelloRequest, htNothing, htFinished, htServerHello]) then
    raise EscError.Create(seUnexpectedPacketType);
is a workaround fixing my current problem, but i can't see over the side effects

Re: unexpected packet type - problem and workaround

Posted: Thu 01 Apr 2021 16:58
by ViktorV
Unfortunately, we are unable to reproduce the problem in our environment based on the information you provide.
Please check if the behavior you specified is reproduced on the new SecureBridge 9.5.1 build, which is already available for download. If it is played again, in order for us to be able to give you a detailed answer, please compose a small sample demonstrating the described behavio and send it to us using contact form https://devart.com/company/contactform.html