AL icon indicating copy to clipboard operation
AL copied to clipboard

HttpClient.AddCertificate method is not working properly

Open jamunoz-pdw opened this issue 7 years ago • 7 comments

Describe the bug When trying to send a request to a web service that needs a certificate there is an error when using AddCertificate method: "Cannot find the requested object". App compiles, it's a runtime error.

To Reproduce

HttpWebContent.WriteFrom(RequestStream);
HttpWebRequest.Content := HttpWebContent;
HttpWebClient.AddCertificate(txtCertificate, txtPassword);
if not HttpWebClient.Send(HttpWebRequest, HttpWebResponse) then
 `Error(CommunicationErr);`

Expected behavior A response from the webservice with data as works in C/SIDE using dotnet. If the line is commented, the webservice sends an expected response "there is no certificate".

Versions: 3.0.121490 and previous versions

jamunoz-pdw avatar Apr 30 '19 07:04 jamunoz-pdw

Hi

What is the Server runtime version? could you send us a full package that repros the issue?

/Pooya

PooyaKharamesh avatar Apr 30 '19 09:04 PooyaKharamesh

Hi

What is the Server runtime version? could you send us a full package that repros the issue?

/Pooya

Hi, I cannot send app due to company regulations.

  "platform": "14.0.29530.29573",
  "application": "14.0.29537.29654",
  "runtime": "2.2",

Thanks in advance

jamunoz-pdw avatar Apr 30 '19 09:04 jamunoz-pdw

Please consider sending a subset of the package or a dummy package that reproes the issue in case you have restrictions on sending the full package.

/Pooya

PooyaKharamesh avatar May 03 '19 09:05 PooyaKharamesh

HI,

Codeunit 10752 SII Doc. Upload Management. developed with pure AL could be the dummy package. HttpWebRequest.ClientCertificates.Add(X509Certificate2); transformed to AL does not response as in C/AL attaching a certificate and a password.

thanks

jamunoz-pdw avatar May 03 '19 10:05 jamunoz-pdw

We will try to investigate the issue that you are facing. Having said that we prioritize to fix the bugs that have a clear repro. A full code unit or a package would help to get the fix faster.

/Pooya

PooyaKharamesh avatar May 03 '19 11:05 PooyaKharamesh

Could be similar to #5299

qutreson avatar Oct 07 '19 12:10 qutreson

Sorry but the error here is "Cannot find the requested object" and the error in #5299 is "The requested operation cannot be performed in this context". The solution in issue #5299 is to CLEAR the HHTPWebClient variable but that solution does not solve the error of this issue.

48010 avatar Dec 27 '19 07:12 48010