Search the Community
Showing results for tags 'thttpcli'.
Found 4 results
-
I have an unusual requirement and wonder if it's possible with ICS. I have an embedded device that can serve web pages using HTTP. The device is usually installed on a private network, so I cannot access it over the Internet. The device has the means to make a socket connection to any port, so it can escape the private network and firewalls. I use a TSslWSocket to listen for a connection from the device and then manually send an HTTP GET command to the device and wait for the reply. There's no SSL involved. This works well for simple GET commands, but I'd like to do more. Is it possible to pass the socket from TSslWSocket to a component like THttpCli? It would be nice to find a way to have a browser in my app talk to the device. Thanks in advance for your help. Richard
- 6 replies
-
- twsocket
- tsslwsocket
-
(and 1 more)
Tagged with:
-
Proxy does not work any more after updating from 8.57 to 8.68
M.e.l posted a topic in ICS - Internet Component Suite
Hi, After updating from v8.57 to 8.68, the proxy setting in my TsslHttpCli component did not work anymore. Proxy: http://xxx.xxx.xxx.xxx:8080/wpad.dat Port: 8080 ProxyUsername / ProxyPassword are also set In unit OverbyteIcsHttpProt, function THttpCli.PrepareNTLMAuth(var FlgClean : Boolean) : Boolean; I did revert that part: 8.68 code: { this flag can tell if we proceed with OnRequestDone or will try } { to authenticate } Result := FALSE; if (httpoNoNTLMAuth in FOptions) and (((FStatusCode = 401) and (FServerAuth = httpAuthNtlm)) or ((FStatusCode = 407) and (FProxyAuth = httpAuthNtlm))) then Exit else if (FStatusCode = 407) and (FDoAuthor.Count > 0) and (FProxyAuthBasicState = basicNone) {$IFDEF UseDigestAuthentication} and (FProxyAuthDigestState = digestNone) {$ENDIF} then begin // V8.61 OAS : remove case where user and PW are empty because used for User credentials { We can handle authorization } TmpInt := FDoAuthor.Count - 1; while TmpInt >= 0 do begin if CompareText(Copy(FDoAuthor.Strings[TmpInt], 1, 4), 'NTLM') = 0 then begin Result := TRUE; if Assigned(FOnBeforeAuth) then FOnBeforeAuth(Self, httpAuthNtlm, FALSE, FDoAuthor.Strings[TmpInt], Result); if Result then begin if (FProxyUsername = '') and (FProxyPassword = '') and not Assigned(FAuthNtlmSession) then // V8.61 FAuthNtlmSession := TNtlmAuthSession.Create (cuOutbound) ; // Create session for proxy NTLM StartAuthNTLM; if FAuthNTLMState in [ntlmMsg1, ntlmMsg3] then FlgClean := True; Break; end; end; Dec(TmpInt); end; end reverted to 8.57 code: { this flag can tell if we proceed with OnRequestDone or will try } { to authenticate } Result := FALSE; if (httpoNoNTLMAuth in FOptions) and (((FStatusCode = 401) and (FServerAuth = httpAuthNtlm)) or ((FStatusCode = 407) and (FProxyAuth = httpAuthNtlm))) then Exit; if (FStatusCode = 401) and (FDoAuthor.Count > 0) and (FAuthBasicState = basicNone) and {$IFDEF UseDigestAuthentication} (FAuthDigestState = digestNone) and {$ENDIF} (FCurrUserName <> '') and (FCurrPassword <> '') then begin { We can handle authorization } TmpInt := FDoAuthor.Count - 1; while TmpInt >= 0 do begin if CompareText(Copy(FDoAuthor.Strings[TmpInt], 1, 4), 'NTLM') = 0 then begin Result := TRUE; if Assigned(FOnBeforeAuth) then FOnBeforeAuth(Self, httpAuthNtlm, FALSE, FDoAuthor.Strings[TmpInt], Result); if Result then begin StartAuthNTLM; if FAuthNTLMState in [ntlmMsg1, ntlmMsg3] then FlgClean := True; Break; end; end; Dec(TmpInt); end; end and... miracle: it did work again !! (with everything else from v8.68).... I am NOT sure that is a bug: I might have something wrong in my code leading to that and need to set some properties to my TSslHttpCli to avoid that... But I don't know what... if somebody can help, thanks in advance Mel -
Hello, Delphi 10.2.3, ICS 8.62 I am reading the settings from an Axis video camera. The payload is XML. Example URI: root:admin@192.168.8.218:80/onvif/device_service The issue, I form up the message, use PostAsync, the data comes back and all is good. I view the process via Wireshark, I see the “Post” and the reply is “HTTP 1.1 401 Unauthorized” and the reply includes: [truncated]Authorization: Digest username="root",realm="AXIS_WS_ACCC8EE4F05C",nonce="sgpPo3OzBQA=f77c1448ee4c9dfe2a268b430a4f4ee824f78950",uri="/onvif/device_service",response="909198f352f89203fe5701378e615379",qop=auth,nc=00000001,cnonc Different values each time, same fields. THttpCli sends the post again, including the above information, and the camera returns the data. I have tried many things. Changing the “serverAuth”, no difference. Another program, I view the stream and it does not have the same cycle. I must be missing something. Ideas? Thanks, Mark
-
THttpCli get request fail with 404 Bad Request result
drazde posted a topic in ICS - Internet Component Suite
Hi, I use THttpCli component (ICS v8.61) for downloading files. It works well in many case, but when I try pass a parameter with space (encoding with "+" or "%20") I have the error 400 Bad Request Why? What can I do? PS: if I put the url in a browser, the request is successful text/html; charset=iso-8859-1 => CONSEGNA Attestazione avvenuta pubblicazione avviso selezione infermiere.eml Location = http://192.168.2.221/cbadoc/upload/2019/08/14/CONSEGNA Attestazione avvenuta pubblicazione avviso selezione infermiere.eml URL = http://192.168.2.221/cbadoc/download.php?file=CONSEGNA+Attestazione+avvenuta+pubblicazione+avviso+selezione+infermiere.eml&id=20878&liv1=2019&liv2=08&liv3=14 Document = CONSEGNA Attestazione avvenuta pubblicazione avviso selezione infermiere.eml RequestDone, no error. Status = 400 Request Failed ! StatusCode = 400 ReasonPhrase = Bad Request