Solved

Problem in Turbo Delphi 2006 with POP3 and SSL connection

Posted on 2007-11-26
11
1,455 Views
Last Modified: 2012-06-21
I had an application compiled with Delphi 7 that did access a POP3 server in SSL mode.
I used a TIdPOP3 and a TIDSSLIOHandlerSocket component and it worked fine
Now I am migrating to Turbo Delphi 2006
I notice I have to use TIDSSLIOHandlerSocketOpenSSL (?) component instead so I just did change that in the code...
But running the newly compiled application, it hangs forever on the Connect method on the POP3 component
What did I miss ?
Some working example ?
0
Comment
Question by:LeTay
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
11 Comments
 
LVL 28

Expert Comment

by:2266180
ID: 20349516
you missed a very important detail:
delphi 7 comes with indy 9. delphi 2006 comes with indy 10.
then, there is another small detail:
- was your application made in the IDE (you dropped the components on the form?) if so, chaning in code will not suffice, since you also have to change the dfm.
the solution in this case, is to open up the project in the IDE, remove the TIDSSLIOHandlerSocket, add the TIDSSLIOHandlerSocketOpenSSL and make the necessary connections between components and property settings (values)
0
 

Author Comment

by:LeTay
ID: 20349575
In fact I know that the indy is now 10 and not 9 anymore
The component is in fact not on the form so I only had to change the definitions
The code looks like this  :
var
 POP3:TIdPOP3;
 SSL:TIdSSLIOHandlerSocketOpenSSL;
begin
 POP3 := TIdPOP3.Create(Application);
 SSL    := TIdSSLIOHandlerSocketOpenSSL.Create(Application);
 SSL.ConnectTimeOut := 5000;
 .../...
 POP3.IOHandler   := SSL;
 POP3.Host            := .../...
 .../...
POP3.Connect;  // => Hangs here forever even with the
.../...
 

0
 
LVL 28

Expert Comment

by:2266180
ID: 20349706
get the latest version of the Open SSL dll's, as indy 10 uses those and not those from intellicom (as indy 9)
I think this is a good link: http://gnuwin32.sourceforge.net/packages/openssl.htm (not sure though as I never used ssl with indy 10 yet)

if that doesn't cut it, try a call to
IdSSLOpenSSLHeaders.Load;
before creteing the sslhandler
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:dinilud
ID: 20349836
0
 
LVL 10

Expert Comment

by:dinilud
ID: 20349876
what is the value of POP3.UseTLS ?
0
 

Author Comment

by:LeTay
ID: 20350011
To dinilud
The default value, which is "utNoTLSSupport"
0
 
LVL 10

Accepted Solution

by:
dinilud earned 500 total points
ID: 20350056
try like this

UseTLS = utUseImplicitTLS
0
 

Author Comment

by:LeTay
ID: 20350282
To ciuly : those found on the link you sent me are older. I tried them but got EidOSSLCouldNotLoadSSLLibrary. So I restored the one I had already which are libeay32.dll and ssleay32.dll. The debug show the call to libeay32.dll followed by a call th ssleay32.dll and followed by a call to rsaenh.dll then it hangs ...
0
 
LVL 10

Expert Comment

by:dinilud
ID: 20350559
i think the problem with UseTLS of POP3.

please check this link

    http://www.indyproject.org/KB/Downloads%5CIndyKB.pdf



What is the difference between implicit TLS and explicit TLS?
0
 

Author Comment

by:LeTay
ID: 20350796
To dinilud : thanks ! This UseTLS settings fixes the problem !
Just one line of code, excellent
I'll give you the points
ps : I will post a second question as now I get an error on SMTP ...
0
 

Author Comment

by:LeTay
ID: 20350893
Finally SMTP is okay as well
Many thanks to all of you
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question