Home » Kerio User Forums » Kerio Control » Problems with "WinHttp.WinHttpRequest.5.1" Script (WinHttpRequest.5.1" Script)

Messages: 1
Karma: 0
Send a private message to this user
hallo forum,

i am using the following script to connecting to a bussiness Partners Webpage.

It uses a "WinHttp.WinHttpRequest.5.1" with a objWinHttp.SetCredentials strLogin, strPassword, 0 Statement.

The script is running proper at a pc without kerio control, but it fires a "HTTP 401 Authorization Required" message in our kerio control 8.4.2 build 2869 enviroment.

do you have any advise what i could do?

thanks for any idea

her ist the script:

Function GetDataFromURL(strURL, strMethod, strPostData)
Dim lngTimeout
Dim strUserAgentString
Dim intSslErrorIgnoreFlags
Dim blnEnableRedirects
Dim blnEnableHttpsToHttpRedirects
Dim strHostOverride
Dim strLogin
Dim strPassword
Dim strResponseText
Dim objWinHttp
lngTimeout = 59000
strUserAgentString = "http_requester/0.1"
intSslErrorIgnoreFlags = 13056 ' 13056: ignore all err, 0: accept no err
blnEnableRedirects = True
blnEnableHttpsToHttpRedirects = True
strHostOverride = ""
strLogin = "xxx"
strPassword = "yyy"
Set objWinHttp = CreateObject("WinHttp.WinHttpRequest.5.1")
'objWinHttp.SetProxy 2, "", "*.xxx.*"
objWinHttp.SetTimeouts lngTimeout, lngTimeout, lngTimeout, lngTimeout
objWinHttp.Open strMethod, strURL
If strMethod = "POST" Then
objWinHttp.setRequestHeader "Content-type", "application/x-www-form-urlencoded"
End If
If strHostOverride <> "" Then
objWinHttp.SetRequestHeader "Host", strHostOverride
End If
objWinHttp.Option(0) = strUserAgentString
objWinHttp.Option(4) = intSslErrorIgnoreFlags
objWinHttp.Option(6) = blnEnableRedirects
objWinHttp.Option(12) = blnEnableHttpsToHttpRedirects
If (strLogin <> "") And (strPassword <> "") Then
objWinHttp.SetCredentials strLogin, strPassword, 0
End If
On Error Resume Next
If Err.Number = 0 Then
If objWinHttp.Status = "200" Then
GetDataFromURL = objWinHttp.ResponseText
GetDataFromURL = "HTTP " & objWinHttp.Status & " " & objWinHttp.StatusText
End If
GetDataFromURL = "Error " & Err.Number & " " & Err.Source & " " & Err.Description
End If
On Error GoTo 0
Set objWinHttp = Nothing
End Function

[Updated on: Thu, 26 February 2015 16:39]


Messages: 557
Karma: 37
Send a private message to this user
Have you reviewed the Web Authentication options on the Kerio Control server that are located in Domains and User Login --> Authentication Options?

You may also want to turn off packet inspection on your mapping rule within Traffic Rules.

Ken Snyder

Messages: 1
Karma: 0
Send a private message to this user
How can i turn off the packet inspection?
Kerio/GFI Brian

Messages: 852
Karma: 90
Send a private message to this user

Brian Carmichael
Instructional Content Architect
Previous Topic: udp or connection close errors
Next Topic: Site-to-Site VPN between Kerio Control and Cisco 892 Router
Goto Forum:

Kerio discussion forums are intended for open communication between forum members and may contain information and material posted by members which may be useful in learning about Kerio products. The discussion forums are not intended to provide technical support for any specific product. Any information implied or expressed in the discussion forums is that of the posting member. Kerio is in no way responsible for the information posted in the forums, or its accuracy. Kerio employees may participate in the discussions, but their postings do not represent an offical position of the company on any issues raised or discussed. Kerio reserves the right to monitor and maintain the forums to promote free and accurate exchange of information.

Current Time: Thu Dec 13 05:09:40 CET 2018

Total time taken to generate the page: 0.80886 seconds
.:: Contact :: Home ::.
Powered by: FUDforum 3.0.4.