My Web Page To PDF - HttpWebRequest and Net.HttpWebResponse error

I inherited a VB.Net website, in which I am coding a function to create an Aspose.Pdf.Document.
It all works on localhost, I create the pdf, but has an error on the server early in the process, before Apose is used.
Here is my code, which works on localhost, up to the point of the error -

Try
System.Net.ServicePointManager.SecurityProtocol = ServicePointManager.SecurityProtocol Or SecurityProtocolType.Tls Or SecurityProtocolType.Tls11 Or SecurityProtocolType.Tls12
Dim request As HttpWebRequest = CType(HttpWebRequest.Create(url), HttpWebRequest)
request.Method = “Get”
request.Credentials = Net.CredentialCache.DefaultCredentials
request.Timeout = 200000
Dim responseFromServer As String = String.Empty
Using response As Net.HttpWebResponse = DirectCast(request.GetResponse(), HttpWebResponse)

The error from the previous statement on the server is -
The underlying connection was closed: An unexpected error occurred on a receive. Inner Exception System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host

Aspose.PDF version is 24.2.0.0
I am using Visual Studio 2019.
.Net targetFramework=“4.8”
Any suggestions would be greatly appreciated!
Thanks!

@hshlom

Looks like the issue is related to some missing configuration. You can please search on internet for similar issues as it does not seem related to the Aspose.PDF API. The forum is specific to discuss only Aspose.PDF related issues. In case you need some assistance regarding API usage or you face some related issues, please let us know.