Skip to content
This repository has been archived by the owner on Jun 7, 2024. It is now read-only.

ShippoExample crashes when trying to create shipment #62

Open
dannyworkingft opened this issue Feb 17, 2021 · 1 comment
Open

ShippoExample crashes when trying to create shipment #62

dannyworkingft opened this issue Feb 17, 2021 · 1 comment

Comments

@dannyworkingft
Copy link

I cloned the repo, opened it using VS Pro 2019, generated my shippo test API token and placed it in APIResource("mytesttoken"). Set my startup project as ShippoExample and pressed the Start button. It built with no error and started running, but the example C# app crashes at the line:

Shipment shipment = resource.CreateShipment(shipmentTable);

with the following (top few lines) from dump of the exception:

System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)

--

did I miss something? (I only changed the API token and added try catch to get more exception details....

@marknguyen85
Copy link

marknguyen85 commented Mar 22, 2021

me too, and i inserted with code here

APIResource resource = new APIResource("xxxxxxx");
 System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

and its workerd

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants