ASP issue: "A certificate is required to complete client authentication"

I’ve also got it working this way plus some modifications…

1- Run the below command from PowerShell as administrator

New-SelfSignedCertificate -DnsName “localhost” -CertStoreLocation “cert:\LocalMachine\My” -NotAfter (Get-Date).AddYears(100)

2- run certlm.msc and find the “localhost” certificate under Personal, right click, select all tasks > manage private keys > add IIS AppPool\yourapppoolname (not the user but the app pool name!)

3- modify your ASP code, add this line : oXMLHttp.setOption 3, “LOCAL_MACHINE\My\localhost”

my code is below

   url="https://api.openai.com/v1/chat/completions"
Set oXMLHttp=Server.Createobject("MSXML2.ServerXMLHTTP.6.0")
oXMLHttp.setOption 2, 13056
oXMLHttp.open "POST", url, False
oXMLHttp.setOption 3, "LOCAL_MACHINE\My\localhost"
oXMLHttp.setRequestHeader "Accept", "application/json"
oXMLHttp.setRequestHeader "Content-Type","application/json"
oXMLHttp.setRequestHeader "Authorization", "Bearer sk-****"
oXMLHttp.setRequestHeader "Content-Length", Len(postparams)
oXMLHttp.send postparams

Voila! everything turned back to normal…

3 Likes

We all seem to have the solution, though we all got to it via different routes.

I installed Certificate Authority on my VPS and created a client certificate for my server. Got it installed with certmgr but had to add a load of different identities to the permissions to get it working (I was expecting IUSR to work, but it didn’t and the apppool wasn’t showing as an identity).

It seems ok now using "setOption(3) = " (yes, setOption 3, also works in ASP Classic) so I’m hoping it’s the effort we’ve all put in to make this work rather than OpenAI rolling something back which may popup again in future.

May the odds be ever in our favour.

Interesting. Option 3 was the first route I took to no avail. I must have done something wrong, maybe it is I was using the certificate thumbprint (as instructed) in the path to certificate, not localhost name. Both IUSR and AppPool identity accounts were granted the read permissions to it.

Thanks a lot, works for me.

ChatGPT suggested the Thumbprint route, but I had to specify the cert location/name to get it working in the end. I really, really hope this is put to bed now because it wasted my entire weekend getting it working.

1 Like

can you claifify what you mean on this? I tried the local certificate and it didn’t work.

The same thing happened to me, I use MSXML2.XMLHTTP in vba and today, when I send the payload, I get the message “failure to download the specified resource”. I don’t know what happened, three days ago it was working

I have the same issue. My code is in Delphi and suddenly it stopped working with the same error!

I spent the weekend on this, too. On the other hand, now I know how to build a COM DLL in C# :smiley:

1 Like

I was in the same situation until 10 hours ago, but it seems to have recovered before implementing any countermeasures. Is there any recovery information available?

Yes working again, We do need an update so we can be confident that it will not revert back, as we build products based on these critical functions