PB6.20B4 - Windows - How to use self signed cert with HTTPRequest?

Everything else that doesn't fall into one of the other PB categories.
User avatar
Kukulkan
Addict
Addict
Posts: 1396
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

PB6.20B4 - Windows - How to use self signed cert with HTTPRequest?

Post by Kukulkan »

Hi,

I try to open a local domain where i run a self signed https page.

Code: Select all

Protected httpRequest = HTTPRequest(#PB_HTTP_Get, url.s)
If httpRequest
  Debug HTTPInfo(HTTPRequest, #PB_HTTP_Response)
  If HTTPInfo(HTTPRequest, #PB_HTTP_StatusCode) = "200" And HTTPInfo(HTTPRequest, #PB_HTTP_Response) = "OK"
    FinishHTTP(HTTPRequest)
    ProcedureReturn #True
  EndIf
  Debug "ERROR: " + HTTPInfo(HTTPRequest, #PB_HTTP_ErrorMessage) + " [" + HTTPInfo(HTTPRequest, #PB_HTTP_StatusCode) + "]"
  FinishHTTP(HTTPRequest)
Else
  Debug "ERROR: Request creation failed"
EndIf
Sadly, I get the following Error:

Code: Select all

ERROR: schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate. [0]
On this machine I installed my root CA in Firefox and it works fine. The same for Chrome.
I also installed my root CA in Windows certificates stores (all users and current user, import as root CA).

It is loading fine in Edge, Chrome and Firefox.
Using curl I have to provide the -k parameter as it seems to ignore all my imported root CA.
PureBasic HTTPRequest triggers the above error.

Is there a way to make HTTPRequest accept my cert?

The same Question for the new WebView gadget...
User avatar
Paul
PureBasic Expert
PureBasic Expert
Posts: 1282
Joined: Fri Apr 25, 2003 4:34 pm
Location: Canada
Contact:

Re: PB6.20B4 - Windows - How to use self signed cert with HTTPRequest?

Post by Paul »

Did you look at the optional flags for HTTPRequest() command?
Image Image
User avatar
Kukulkan
Addict
Addict
Posts: 1396
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: PB6.20B4 - Windows - How to use self signed cert with HTTPRequest?

Post by Kukulkan »

Paul wrote: Fri Jan 31, 2025 6:30 pm Did you look at the optional flags for HTTPRequest() command?
Oh, shit :shock: I really missed that... Thanks!
The same Question for the new WebView gadget...
And for the WebView? I just checked the documentation here, too. But can't find something related?
Post Reply