Solved

Problem in Turbo Delphi 2006 with POP3 and SSL connection

Posted on 2007-11-26
11
1,441 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
  • 5
  • 4
  • 2
11 Comments
 
LVL 28

Expert Comment

by:ciuly
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:ciuly
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
 
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

758 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now