CreateObject("MSXML2.ServerXMLHTTP") not working (1 Viewer)

smig

Registered User.
Local time
Today, 15:39
Joined
Nov 25, 2009
Messages
2,209
I'm using CreateObject("MSXML2.ServerXMLHTTP") for long time to automatically download files from my server

recently I can't download getting an error with secured channel
I get the error on .Send

it does not netter if I send the file to get as HTTP or HTTPS

the files are public so no need for UserName or Password

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
 
 
ExitHere:
    Set xmlHTTP = Nothing
    Exit Function
 
errHere:
    fnDownloadHTTP = False
    Resume ExitHere

End Function
 

CJ_London

Super Moderator
Staff member
Local time
Today, 13:39
Joined
Feb 19, 2013
Messages
16,553
not sure I can suggest anything - but what is the error description?
 

smig

Registered User.
Local time
Today, 15:39
Joined
Nov 25, 2009
Messages
2,209
not sure I can suggest anything - but what is the error description?
RunTime error -2147012739 Error support the secured channel (Translated from Hebrew)
 

CJ_London

Super Moderator
Staff member
Local time
Today, 13:39
Joined
Feb 19, 2013
Messages
16,553
take a look at this link - it suggests a slight different object
 

smig

Registered User.
Local time
Today, 15:39
Joined
Nov 25, 2009
Messages
2,209
Do you need the actual file, or just the contents?
Though at the end process I will need to download files, reading the content will be great :)
It's a simple one short line content with a version number
 

cheekybuddha

AWF VIP
Local time
Today, 13:39
Joined
Jul 21, 2014
Messages
2,237
With the following simple function:
Code:
Function HTTP_Get(webServiceURL As String) As String

  Const XMLHTTP             As String = "MSXML2.ServerXMLHTTP", _
        METHOD_GET          As String = "GET", _
        HTTP_STATUS_SUCCESS As Integer = 200
    
  With CreateObject(XMLHTTP)
    .Open METHOD_GET, webServiceURL, False
    .setRequestHeader "cache-control", "no-cache,must revalidate"
    .Send
    If .Status = HTTP_STATUS_SUCCESS Then
      HTTP_Get = .ResponseText
'      Debug.Print .getAllResponseHeaders
'      Debug.Print .responseBody
    Else
      Debug.Print .Status & ": " & .StatusText
    End If
  End With
  
End Function
This is what I get in the Immediate Window (Ctrl+G):
Code:
?HTTP_Get("http://noam.fuchsapps.com/App/Update/NoamLekochotVersion.txt")
11.188

hth,

d
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 08:39
Joined
Feb 28, 2001
Messages
26,999
When I look up error -2147012739 (which is, in hex 80072F7D) it tells me that there is some error in the encryption algorithm. By any chance did you have an upgrade of any sort - either on YOUR end or on the other end of this connection? It seems to be saying that the server certificate cannot be decoded. The suggestion is that you need to somehow update your Crypto API.

This is an older reference:


Not quite as old but similar concept: Something is out of date


I've looked at several other links and they all more or less give variants of the same issue - that due to something being updated or something going out of date, you cannot establish the session because of a hashing method mismatch. It seems to be somewhat generic in that more than one kind of mismatch can trigger this.
 

smig

Registered User.
Local time
Today, 15:39
Joined
Nov 25, 2009
Messages
2,209
With the following simple function:
Code:
Function HTTP_Get(webServiceURL As String) As String

  Const XMLHTTP             As String = "MSXML2.ServerXMLHTTP", _
        METHOD_GET          As String = "GET", _
        HTTP_STATUS_SUCCESS As Integer = 200
   
  With CreateObject(XMLHTTP)
    .Open METHOD_GET, webServiceURL, False
    .setRequestHeader "cache-control", "no-cache,must revalidate"
    .Send
    If .Status = HTTP_STATUS_SUCCESS Then
      HTTP_Get = .ResponseText
'      Debug.Print .getAllResponseHeaders
'      Debug.Print .responseBody
    Else
      Debug.Print .Status & ": " & .StatusText
    End If
  End With
 
End Function
This is what I get in the Immediate Window (Ctrl+G):
Code:
?HTTP_Get("http://noam.fuchsapps.com/App/Update/NoamLekochotVersion.txt")
11.188

hth,
When I look up error -2147012739 (which is, in hex 80072F7D) it tells me that there is some error in the encryption algorithm. By any chance did you have an upgrade of any sort - either on YOUR end or on the other end of this connection? It seems to be saying that the server certificate cannot be decoded. The suggestion is that you need to somehow update your Crypto API.

This is an older reference:


Not quite as old but similar concept: Something is out of date


I've looked at several other links and they all more or less give variants of the same issue - that due to something being updated or something going out of date, you cannot establish the session because of a hashing method mismatch. It seems to be somewhat generic in that more than one kind of mismatch can trigger this.
Thanks

I'll try to ask the server holder for assist
d
I get the same error, on .Send :(
 

smig

Registered User.
Local time
Today, 15:39
Joined
Nov 25, 2009
Messages
2,209
When I look up error -2147012739 (which is, in hex 80072F7D) it tells me that there is some error in the encryption algorithm. By any chance did you have an upgrade of any sort - either on YOUR end or on the other end of this connection? It seems to be saying that the server certificate cannot be decoded. The suggestion is that you need to somehow update your Crypto API.

This is an older reference:


Not quite as old but similar concept: Something is out of date


I've looked at several other links and they all more or less give variants of the same issue - that due to something being updated or something going out of date, you cannot establish the session because of a hashing method mismatch. It seems to be somewhat generic in that more than one kind of mismatch can trigger this.
How do I update my Crypto API ?
 

Users who are viewing this thread

Top Bottom