GET and POST questions

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
Bridgebuilder
Posts: 1
Joined: Wed 22 Jul 2020 08:52

GET and POST questions

Post by Bridgebuilder » Thu 23 Jul 2020 09:29

It was hard to come up with a descriptive subject, since there are many factors involved. Please feel free to change the subject if you have a better suggestion after reading this post.

We have a customer that uses our program to create invoices, which we send with a http POST to their accounting system.
We also use GET to query information about customers, articles, and more.

This worked well when running on their internal network, using Basic Authentication.
Then they decided to move everything to Azure, and use OAuth2 for Authentication.
After the move, GET still worked, but POST gave Socket Error #10060. A little more testing, and I noticed that POST with a Json less than about 8kb worked as expected, but mostly they are about 20kb.
At this time I was using Indy's TIdHttp component.

Our main program is written in Delphi 7, but I have made a separate smaller application for just testing the communication that I have also compiled in Delphi XE5.
In XE5 I had SecureBridge 8.2 that I used on a previous project. I made a copy of the test application and rewrote it to use TscHttpWebRequest. It showed the same symptoms, and for POSTs larger than 8kb I got a messagebox with the text:
Error on data reading from the connection: An existing connection was forcibly closed by the remote host.

I assume that has the same meaning as Socket Error #10060?

I realised my version of SecureBridge was quite old, so I downladed the latest trial version.
Without changing anything I just recompiled the test application. Now both GET and POST gives me a messagebox that says:
Protocol error: unexpeced packet type.

I guess there has been internal changes between those versions. Anyway, I have tried altering properties, like setting all IgnoreServerCertificate and TrustServerCertificate to True. I've tried only allowing Protocol spTls1. I've tried using SendChunked with a SendBlockSize less than 8kb. But get the same Protocol Error whatever I do.

I can also add that first I make a POST to a different url to get an AccessToken which is valid for one hour. That POST works though.
The AccessToken received I add with, Headers.Add('Authorization', 'Bearer ' + AccessToken) , before performing GET or POST to the other url.

One more thing to mention. Using third-party application Postman, all GETs and POSTs works. What can Postman do differently than my Delphi-application?

Do you have any ideas, or suggestion on what I might be doing wrong?

Hope I'm not just rambling and that some of what I've written makes sense.

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: GET and POST questions

Post by ViktorV » Fri 24 Jul 2020 13:20

In order to get a detailed answer, please compose a full sample demonstrating the specified behavior and send it to us through the contact form (https://devart.com/company/contactform.html).

Post Reply