procedure TMM7Soap.DoRequest(const AMethod: TIdHTTPMethod; AURL: string;
const ASource, AResponseContent: TStream);
var
LProto: string;
OldHandler: TIdIOHandler;
{$ENDIF}
begin
{$IFDEF DELPHI6}
ProtocolVersion := Pv1_1;
ParseURI(AURL, LProto, LHost, LPath, LDoc, LPort, LBookmark);
{$ELSE}
Url.Uri := AURL;
LProto := Url.Protocol;
OldHandler := nil;
{$ENDIF}
if AnsiSameText(UpperCase(LProto), 'HTTPS') then //create https object
begin
{$IFDEF DELPHI6}
if Ssl = nil then
begin
Self.SSL := TIdConnectionInterceptOpenSSL.Create(nil);
end;
SSl.SSLOptions.Method := sslvSSLv23;
Self.Intercept := SSl;
Ssl.OnGetPassword := Self.SSLGetPassword;
Self.SocksInfo.Host := ''; //不支持同时使用socks和https
Self.SocksInfo.Port := 0;
Self.SocksInfo.Version := svNoSocks;
{$ELSE}
if Ssl = nil then
begin
Self.SSL := TIdSSLIoHandlerSocket.Create(nil);
Ssl.SocksInfo := nil;
end;
SSl.SSLOptions.Method := sslvSSLv23;
if (Self.IOHandler is TIdIOHandlerSocket) and
((Self.IOHandler as TIdIOHandlerSocket).SocksInfo <> nil) then
begin
// Ssl.SocksInfo := (Self.IOHandler as TIdIOHandlerSocket).SocksInfo;
// don't support
end;
OldHandler := Self.IOHandler;
Self.IOHandler := SSl;
Ssl.OnGetPassword := Self.SSLGetPassword;
{$ENDIF}
end
else
{$IFDEF DELPHI6}
Self.Intercept := nil;
{$ELSE}
Self.IOHandler := nil;
{$ENDIF}
try
inherited;
finally
{$IFNDEF DELPHI6}
if OldHandler <> nil then
Self.IOHandler := OldHandler;
{$ENDIF}
end;
end;
拷贝libeay32.dll和libeay32.dll