Then in the (#javascript) application, after the .open() method is called, do:
objHTTP.setOption(3) = "LOCAL_MACHINE\\My\\nameOfYourCertificate";
At that point we could make the same API calls we made yesterday. Weird.
To create the certificate, open an Admin Powershell console:
New-SelfSignedCertificate `
-DnsName "nameOfYourCertificate" `
-KeyAlgorithm RSA `
-KeyLength 2048 `
-CertStoreLocation "Cert:\LocalMachine\My" `
-NotAfter (Get-Date).AddYears(10)
certlm.msc
Expand Personal > Certificates
Right click on "nameOfYourCertificate"
All Tasks > Manage Private Keys
[Add]
"Network Service"
✔ Read
❌ Full Control
[OK]
Close window
A very geeky thread about an extremely niche issue involving the #OpenAI #API, #ServerXMLHTTP or #WinHTTP requests and a self-signed certificate.
Until yesterday we could make simple API calls to the OpenAI API with our API token and all was well. That broke as of today with error "A certificate is required to complete client authentication".
The obscure fix has been to create a self-signed certificate and invoke it against the HTTP request.
Details to follow...