Attempting to update the portal integration components from policy manager->tasks->Extensions and Add-Ons->Update Portal Integration
was failing with the following error: Unable to update: Unexpected end of file from server
Gateway 9.x, 10.x
It was determined that this particular gateway was configured to go through a proxy for HTTP connections.
Looking at Policy Manager->Tasks->Transports->Manage HTTP Options
we could see the proxy configuration was configured and in place.
In this particular case there was a problem with the defined proxy host where it was closing the connection request from the gateway.
The proxy configuration was removed from the gateway as it was not needed. Once removed we could successfully update the portal integration components.