How to add certificate in http client

Hi,

I have smp server url and added one application in that application backend is having one web service. if i hit that smp server url it will return the meta data of the service. The issue is we need to add certification for that server via code and need to get resposne from that via http client. 

Please find the code below

  var client = new SAP.Net.Http.HttpClient(new HttpClientHandler
                {
                    Credentials = new NetworkCredential("Server username", "server Password),
                    ClientCertificateOptions = ClientCertificateOption.Automatic,
                    UseProxy = false
                },
                true);
var response = await client.GetAsync("server ip:Portno/application name");

When sending this request to http i am geting "The server committed a protocol violation. Section=ResponseStatusLine" this issue. I installed certificate in machine and also in application.

Please let me know how to fix this.

April 8th, 2015 10:08am

Hello Dinesh,

As this issue is related to Web development, it is recommended to post in the MSDN Internet Explorer Web Development forum.
The professionals there will be glad to help you.
https://social.msdn.microsoft.com/Forums/ie/en-US/home?forum=iewebdevelopment

Thanks for your understanding.

Best regards,
Fangzhou CHEN

Free Windows Admin Tool Kit Click here and download it now
April 9th, 2015 3:57am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics