shippo-csharp-client icon indicating copy to clipboard operation
shippo-csharp-client copied to clipboard

ShippoExample crashes when trying to create shipment

Open dannyworkingft opened this issue 4 years ago • 1 comments

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....

dannyworkingft avatar Feb 17 '21 23:02 dannyworkingft

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

marknguyen85 avatar Mar 22 '21 06:03 marknguyen85