Solved

Problem in Turbo Delphi 2006 with POP3 and SSL connection

Posted on 2007-11-26
11
1,450 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to convert wav to mp3 in delphi 9 221
add combobox item based on numbers 9 154
Intraweb download file link ? 1 153
How to define IfThen functions in one common unit? 4 58
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…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

809 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