Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Delphi 2007 - Indy 10 - TidHttp - IOHandler value is not valid error

5,894 views
Skip to first unread message

Kevin Frevert

unread,
Dec 4, 2007, 10:23:19 AM12/4/07
to
After upgrading from D6 (Indy 9) to Delphi 2007 (default Indy 10
components), and attempting to send/receive (xml) data from a secured site
(https) I received the error/exception 'IOHandler value is not valid'.

OK, I searched around and find out I need a 'Handler' component, which I did
not need before (code has gone unchanged since 2004)

I try out TIdServerIOHandlerSSLOpenSSL (no changes to the component) and
when I attempt again, I receive the error/exception 'Socket Error # 11004'

I went as far as downloading the OpenSSL dlls and placing them in the
application's directory, same error.

A bit frustrating to say the least.

Is there a workaround? What's the trick in using the TidHttp component
against https sites? Has Indy feature-creeped itself into obscurity and
it's time to use something else?

Thanks for any info,
krf


Kevin Frevert

unread,
Dec 4, 2007, 11:56:49 AM12/4/07
to
I used another machine and I no longer get the socket error (apparently
networking is getting creative again with our dns), but now it's a read
time-out error (almost immediately after calling Get).

Dang, it shouldn't be this hard.

function TdmUSPSCustomsFormCP72.GetResponse(const URL, XML: String): String;
var
WebURL: string; {for debugging}
URI :TIdURI;
begin
Result := '';
URI := TIdURI.Create();
try
WebURL := URL + '&XML=' + URI.ParamsEncode(XML);
{debugging code snipped}
try
Result := IdUSPSCustomsServer.Get(WebURL);
{debugging code snipped}
except
on E: Exception do
begin
Result := E.Message;
end;
end;
finally { wrap up }
URI.Free();
end; { try/finally }
end;


"Kevin Frevert" <kevin@workdrinkingicewater> wrote in message
news:475570a4$1...@newsgroups.borland.com...

Remy Lebeau (TeamB)

unread,
Dec 4, 2007, 12:54:38 PM12/4/07
to

"Kevin Frevert" <kevin@workdrinkingicewater> wrote in message
news:475570a4$1...@newsgroups.borland.com...

> I received the error/exception 'IOHandler value is not valid'.

That error only occurs if you do not have a
TIdSSLIOHandlerSocketBase-derived component, such as TIdSSLIOHandlerOpenSSL,
assigned to the TIdHTTP's IOHandler property.

> OK, I searched around and find out I need a 'Handler' component,
> which I did not need before (code has gone unchanged since 2004)

Yes, you did. TIdHTTP has never implemented SSL directly. It has always
required a separate SSL component be attached to it.

> I try out TIdServerIOHandlerSSLOpenSSL

That is a server-side IOHandler, not a client-side IOHandler. TIdHTTP is a
client-side component. You can't use TIdServerIOHandlerSSLOpenSSL with it.


Gambit


Kevin Frevert

unread,
Dec 4, 2007, 1:58:31 PM12/4/07
to
"Remy Lebeau (TeamB)" <no....@no.spam.com> wrote in message
news:475594b2$1...@newsgroups.borland.com...

>
> "Kevin Frevert" <kevin@workdrinkingicewater> wrote in message
> news:475570a4$1...@newsgroups.borland.com...
>
>> I received the error/exception 'IOHandler value is not valid'.
>
> That error only occurs if you do not have a
> TIdSSLIOHandlerSocketBase-derived component, such as
> TIdSSLIOHandlerOpenSSL, assigned to the TIdHTTP's IOHandler property.
>
>> OK, I searched around and find out I need a 'Handler' component,
>> which I did not need before (code has gone unchanged since 2004)
>
> Yes, you did. TIdHTTP has never implemented SSL directly. It has always
> required a separate SSL component be attached to it.
>

A little background, I am interfacing with the USPS international customs
form generation "web service". I just found out from the floor supervisor
that they have never used the generated forms. They ignore the 'Print'
pop-up and handle the paperwork manually (why is a long answer). I'm so
glad he left out that little detail from the escalated 'emergency' helpdesk
ticket and I wasted almost two days.

Apparently this has never worked since USPS went to https. The issue came
to light because of a missing property exception at run-time(D6->2007
issue).
Now the component has been updated, the application is 'working' normally.

>> I try out TIdServerIOHandlerSSLOpenSSL
>
> That is a server-side IOHandler, not a client-side IOHandler. TIdHTTP is
> a client-side component. You can't use TIdServerIOHandlerSSLOpenSSL with
> it.

That was stupid, yes it was the other ssl one. I wrote this message on my
laptop and the project is on my desktop and I copy/pasted from the first
thing I saw that had ssl from the help.

Thanks,
krf


0 new messages