HttpClient Request get 401 "No Client Cert"

Anonymous
2022-07-05T13:33:33.467+00:00

Xamarin Forms making a HttpClient Post from the simulator with a .p12 certificate attached. It keeps returning 401 "No Client Cert" from the REST Service. I created a separate console C# application with the same code and it works fine, I get a 200 response from the server plus content which is expected.

The only difference I note is that the C# console application is using .NET Core 3.1 and the Xamarin Forms app is using .NET Standard 2.1

Developer technologies | .NET | Xamarin
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2022-07-06T07:04:04.747+00:00

    Hello,​

    Did you add accessToken in request header?

    If not, please use AuthenticationHeaderValue to add accessToken in request header.

       HttpClient client = new HttpClient();  
       client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", ACCESS_TOKEN);  
    

    If you add it, this issue still exists. Please share minimize code.

    Best Regards,

    Leon Lu


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.