HTTPS Secured channel error (1 Viewer)

smig

Registered User.
Local time
Today, 22:46
Joined
Nov 25, 2009
Messages
2,209
I'm using VBA to download files from my domain (A Sub Domain)
I'm getting an error that there is a problem with the secured channel.

This will happen if I try to Download the file using HTTPS address but will not if I use unsecured HTTP addres
The domain do have SSL, and I have no problem seeing the file using the same HTTPS address on the browser.
HTTPS Text File

Code:
Public Function fnDownloadHTTP(strTarget As String, strSaveAs As String, Optional strUserName As String, Optional strPassword As String) As Boolean

' On Error GoTo errHere

Dim xmlHTTP As Object
Dim strRespText As String

fnDownloadHTTP = True

'Set xmlHTTP = CreateObject("Microsoft.XMLHTTP")
Set xmlHTTP = CreateObject("MSXML2.ServerXMLHTTP")

With xmlHTTP
.Open "GET", strTarget, False, strUserName, strPassword
.setRequestHeader "cache-control", "no-cache,must revalidate"
.send
End With

If fnSaveDownloadFile(strSaveAs, xmlHTTP.responseBody) = False Then
fnDownloadHTTP = False
End If
 
Last edited:

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 20:46
Joined
Jul 9, 2003
Messages
16,245
Hi smig, May the 4th be with you. I'm bumping your post up the list hoping it gets another look!
 
Last edited:

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 15:46
Joined
Feb 28, 2001
Messages
27,001
Here is a discussion about using HTTPS via VBA from Excel:


Seems like you have to do something with one of the Windows networking APIs in order to get there.

Here's another take on the problem that explicitly discusses authentication issues with HTTPS sites.


I've never tried either but I found these after a web search. No guarantees, no claims to make. But it is clear you are not alone in what you are trying - and in the difficulties you are having.
 

Users who are viewing this thread

Top Bottom