Hello ICS-Users,
I used Indy-Components for a long time, i stucked when i tried to access an
AXIS-Camera with a very high resolution. Everything worked fine,
including access via SSL, but TIdHTTP produced enourmous CPU-Load (One
Camera-Stream without any processing, only receiving data leads to about
12%
CPU-Load on my i7-7700k).
So i came to ICS and tried it out. With http, i have approx. 0.3% CPU
Load for the same task. Great. Then I tried to use SSL (ssleay32 and
libeay32.dll are in its place) and here is where I stuck...
I only receive one packet from the camera saying "// This is the only
packet we get when trying https:
//<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
//<html><head>
//<title>401 Unauthorized</title>
//</head><body>
//<h1>Unauthorized</h1>
//<p>This server could not verify that you
//are authorized to access the document
//requested. Either you supplied the wrong
//credentials (e.g., bad password), or your
//browser doesn't understand how to supply
//the credentials required.</p>
//</body></html>".
This is my Main-Method:
procedure TTestThread.Execute;
begin
SslHttpCli := TSslHttpCli.Create(nil);
SslHttpCli.Username := 'root';
SslHttpCli.Password := '1234';
SslHttpCli.OnBeforeAuth := SslHttpCliBeforeAuth;
SslHttpCli.OnDocData := SslHttpCliDocData;
SslHttpCli.SslContext := TSslContext.Create(SslHttpCli);
SslHttpCli.SslContext.SslMinVersion := sslVerTLS1;
SslHttpCli.OnSslVerifyPeer := SslHttpCliSslVerifyPeer;
SslHttpCli.OnSslHandshakeDone := SslHttpCliSslHandshakeDone;
//SslHttpCli.ServerAuth := httpAuthDigest;
while not terminated do
begin
SslHttpCli.URL := 'https://192.168.56.99/axis-cgi/mjpg/video.cgi';
// http is working fine, auth is no problem then...
SslHttpCli.Get;
end;
SslHttpCli.Free;
end;
and these are the additional methods:
procedure TTestThread.SslHttpCliSslVerifyPeer(Sender: TObject; var Ok:
Integer; Cert: TX509Base);
begin
// We never get here
OK := 0; //??
end;
procedure TTestThread.SslHttpCliSslHandshakeDone(Sender: TObject;
ErrCode: Word; PeerCert: TX509Base; var Disconnect: Boolean);
begin
// Here we are 1st
// ErrCode is 0
Disconnect := FALSE;
end;
procedure TTestThread.SslHttpCliBeforeAuth(Sender: TObject; AuthType:
THttpAuthType; ProxyAuth: Boolean; const AuthHdr: string;
var Allow: Boolean);
begin
// Here we are 2nd
// AuthType is httpAuthDigest
// AuthHdr = 'Digest realm="AXIS_ACCC8E1CF5D6",
nonce="39lra5ZmBQA=8c4897b58b35609ca5635c95d3738bd590a730a6",
algorithm=MD5, qop="auth"'
Allow := TRUE;
end;
Do someone has any idea, what i need to do to establish a SSL-Connection to
my camera?
Thank you very much for any ideas and hints...
Best regards,
Oliver Dahlmann
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be