Subject Re: HTTPS and a proxyserver
From Boris Borzic <.> <Boris Borzic <.>>
Date Thu, 29 Apr 2021 16:56:07 -0400
Newsgroups xb2net

I believe what you need to do is something like this:

oHttp := xbHTTPClient():new()
oSSL  := xbSSLContext():new(TLS_client_method)
oHttp:SSLContext := oSSL
oHTTP:SetProxy("proxyserver", 8080)
oResponse := oHttp:Execute("http://www.website.com")

//....
oHttp:destroy()
oSSL:destroy()

Alternatively, you can use WinInet to use the Windows proxy settings:
oHttp:Transport == VIA_WININET

--
Best regards,
Boris Borzic

http://xb2.net
http://sqlexpress.net
industrial strength Xbase++ development tools


Frans Vermeulen <fv@gbor.nl> wrote in
news:20210429171950.e2252ac3c3be49b87d0fd00e@gbor.nl:

> Did anyone successfully establish connections through a HTTPS-proxy?
>
> When I do this:
>
>    // create an HTTP client instance
>    oHttp := xbHTTPClient():new()
>
>    oHTTP:SetProxy("proxyserver", 8080)
>
>    ? "executing HTTP request..."
>    oResponse := oHttp:Execute("http://www.website.com")
>
> I get a response. (HTTP 403) which is correct: this is not allowed on
> this server.
>
> If either I set an SSL-context to the xbHttpClient, or change the
> "http://..." in "https://..." or change the port to 443, I can see
> that: no data with the proxy is exchanged. oResponse remains Nil.
>
> I suspect in these cases, a secure connection is setup with the proxy,
> which is not understood by the proxy.
>==> my guess comes from reading the following article.
> https://stackoverflow.com/questions/58559109/difference-between-http-pr
> oxy-and-https-proxy
>
> Am I missing the setting, that should be done, in order to establish
> an HTTPS-connection through a proxy?
>


Recent messages in this thread
 
-# HTTPS and a proxyserver Frans Vermeulen 29-Apr-2021 11:19 am
.-# Re: HTTPS and a proxyserver (Current message) Boris Borzic <.> 29-Apr-2021 04:56 pm
..-# Re: HTTPS and a proxyserver Frans Vermeulen 30-Apr-2021 04:21 am
...-# Re: HTTPS and a proxyserver Boris Borzic <.> 30-Apr-2021 10:48 pm
....-# Re: HTTPS and a proxyserver Frans Vermeulen 03-May-2021 04:58 am
.....\# Re: HTTPS and a proxyserver Boris Borzic <.> 03-May-2021 07:36 pm