cpprestsdk icon indicating copy to clipboard operation
cpprestsdk copied to clipboard

WinHttpReceiveResponse: 12044: A certificate is required to complete client authentication

Open mandarsudame opened this issue 6 years ago • 3 comments

I keep getting 12044 error when using Bearer token auth while making a Post/Put calls using http_client. I am not using the oauth2 config since I have a different mechanism to get the access token. So, all I am doing is adding the access token with 'Bearer' prefix to the authorization header: requestmessage.headers().add(L"Authorization", L"Bearer " + accessToken);

But it keeps giving me the following error: WinHttpReceiveResponse: 12044: A certificate is required to complete client authentication

mandarsudame avatar Apr 01 '19 22:04 mandarsudame

Sounds like the particular web server you are connecting to requires a client certificate via mTls. This failure indicates that it's never getting far enough to even consider your Auth token, so that's not the problem. As far as I know mTLS is not yet supported in cpprestsdk. You'd have to add modify the WinHttp client to supply a client cert when this event is encountered.

deeringc avatar Apr 19 '19 22:04 deeringc

@mandarsudame I am currently struggling with the same problem as you did. Can you tell how you solved it in the end?

magel20 avatar Sep 30 '20 07:09 magel20

@mandarsudame @magel20 I am also facing same issue since 2 weeks can you please let me know what is the solution for this Thanks

paddi537 avatar Jan 30 '23 18:01 paddi537