Solved

Problem in Turbo Delphi 2006 with POP3 and SSL connection

Posted on 2007-11-26
11
1,445 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: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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Filemaker 14 vs Delphi Embarcadero 7 186
Best Firemonkey component pack 1 86
Dev Express grid collapse 2 39
control image tags in a string ? 12 110
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…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Edureka is one of the fastest growing and most effective online learning sites.  We are here to help you succeed.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

911 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

19 Experts available now in Live!

Get 1:1 Help Now