使用HTTPs协议的互连网通信 ( 积分: 100 )

  • 主题发起人 主题发起人 SkyKing
  • 开始时间 开始时间
S

SkyKing

Unregistered / Unconfirmed
GUEST, unregistred user!
在Delphi6.0版里如何开发支持HTTPs传输协议的互联网通信程序?知道的请描述的详细点,有个Demo最好。
 
在Delphi6.0版里如何开发支持HTTPs传输协议的互联网通信程序?知道的请描述的详细点,有个Demo最好。
 
关注...
咋成灌水了?
 
Indy10可以支持https传输协议,该控件支持Delphi6(但需要打Update2和RTLUpdate3后才行)。下载地址可以在google里面直接搜indy找到。最新版好像是10.0.5吧,不记得了,你去官方看看。另外,这里有篇文章,介绍如何用Indy连接https的网站(如gmail)
GMail is the free mail service of Google.
Recently, the GMail accounts can also be accessed by means of POP3 and SMTP protocols (that is to say, to use them through a mail client program like OutLook)
It has a peculiarity, the access to GMail through POP3 uses encriptación SSL and No-Standard ports.
This tip explains briefly how to connect with POP3 service of GMail through the indy components.

You need to put in one form these components:




A TidPop3 (idPop31) (indy Clients Tab)

A TidMessage (idMessage1) (indy Misc Tab)

A TIdSSLIOHandlerSocket (IdSSLIOHandlerSocket1) (indy I/O handlers Tab)

A TMemo (Memo1)

A TButton (Button1)



So that the SSL works, the indy uses the OpenSSL library, that is GPL and that another people do, for that reason, you have to download it so that the TIdSSLIOHandlerSocket can use it.

I for this test, have downloaded it of: http://indy.fulgan.com/SSL/and the file that I have used is indy_openssl096.zip

Descompress the the ZIP and put the two DLLs in the directory of your project.

Now, make that idPop31 uses the IdSSLIOHandlerSocket1 putting it in its IOHandler property.

Set the name of the pop server in the Host property of idPop31, that in the case of Gmail is pop.gmail.com, set the port, that in this case is special and is 995 and set the username and your password in the idPop31 component.


Once made, to test the invention, put this code in the OnCLick de Button1:

procedure TForm1.Button1Click(Sender: TObject);
var
n,
nummsgs : integer;
begin
Memo1.Lines.Clear;
//Conectamos!
idpop31.Connect(0);

//Obtenemos el numero de emails que tenemos
NumMsgs:=idpop31.CheckMessages;

Memo1.lines.add( 'Emails:' +IntToStr(NumMsgs) );

for n:=1 to NumMsgs do begin
idpop31.RetrieveHeader(n,idMessage1);
Memo1.Lines.Add( 'Email Nº:'+IntToStr(n)+
' De:'+idMessage1.From.Text+
' Tema:'+idMessage1.Subject );
idMessage1.Clear;
end;
idpop31.Disconnect;
end;

and you will have an example that will obtain the headers of the emails of GMail account.

NOTE: Yo need an actual version of the indy library. If your Delphi hasn't, dont worry, you can download it from the oficcial website: http://www.indyproject.org/
 
没干过.不过嗅探HTTPS倒干过.
证书格式:X.509(只有公钥)和PKCS12(公钥和私钥),编码方式:PEM和DER:压缩-mac-对称加密-tcp/ip
 
能解决我的问题么?不能解决就是个垃圾控件~
http://www.delphibbs.com/delphibbs/dispq.asp?lid=3282262
 
后退
顶部