Source code of HTMLViewer for https addresses

I cannot get the source code for https pages using the HTMLViewer. HTMLVIEWER does show the web page, so it is going there. This is what I do when the web address is http:

in HTMLViewer CancelLoad

dim SCode as string
dim http as New HTTPSocket
http.Yield=true
SCode = http.Get(URL,30)
http.close

That works for http addresses, but if the address starts with https, I get nothing.

HTTPSocket only knows about HTTP. Use the HTTPSecureSocket for HTTPS.

I have tried that already, but it does not work either.

try setting the Secure property to true and the ConnectionType to SSLSocket.SSLv23. Regardless of the name, it’ll start with the highest encryption and work it’s way down until it finds one that the server can accommodate.

You cannot get thecontent of webhtmlviewer if is not onthe same domain.

Use securehttpsocket instead.

Thanks, Michel, I suspected that might be the problem. The source I would get would only say that I was being redirected or that the location was permanently moved, but would not give the new location. I have in the past built a rudimentary browser using the TCP socket control, and know the handshake for http, but the https handshake is much more complicated and I would have to get a private key. I do like to learn and all of this is probably possible, but I have no examples with xojo to follow. Can you suggest any resources I could get access to?

As an alternative, what about using a TCP Socket or SSLsocket to act as a packet sniffer? Is that possible with xojo?

Thanks again Michel

The new location is provided as the Location header rather than in the body of the response. You can receive it in the HTTPSecureSocket’s HeadersReceived event:

Sub HeadersReceived(headers as internetHeaders, httpStatus as integer)
  Dim url As String = headers.CommaSeparatedValues("Location")
  
End Sub