I'm just started searching for library to build client part of our SSL application.
It must support handling of both HTTP(S) and raw SSL.
What we need is async raw data sending/receiving and async sending of HTTP/HTTPS requests,
SOCKS, Proxy tunneling, ability to make both raw SSL connections or HTTP/HTTPS requests.
There is some details, so which I have some main questions.

How to eslablish SSL connection using ElHTTPSClient without sending HTTP request?
If it is possible, can I use SendData/OnData to asynchronously send/receive data whith that established connection?

Assume I established a persistent plain-HTTP connection to my server,
and we are not closing it. How can I asynchrounously send both /raw data/ or /http requests/ whithin that connection?

All that stuff must use non-blocking sockets, or blocking sockets with multithreading in library.
We don't need to care about main thread blocking.

I need an advice on how to build such application with SBB most correctly and effectively.
Maybe in common with some other libs (Indy,ICS,..).

Use TElSimpleSSLClient instead. ElHTTPSClient is a descendant of TElSimpleSSLClient which adds HTTP(S).

Quote

Albert Schmidt wrote:
Assume I established a persistent plain-HTTP connection to my server,
and we are not closing it. How can I asynchrounously send both /raw data/ or /http requests/ whithin that connection?

I can hardly imagine such situation and I think that in this case you need create and parse HTTP requests/responses yourself. An alternative would be to create a proxy (to which the HTTP client will connect), but this can be a bit complicated. Not very much, but extra complexity is present...

Quote

Albert Schmidt wrote:
All that stuff must use non-blocking sockets, or blocking sockets with multithreading in library.

SimpleSSLClient (and ElHTTPSClient consequently) works in blocking mode, so you would need to run it within a thread.

Use TElSimpleSSLClient instead. ElHTTPSClient is a descendant of TElSimpleSSLClient which adds HTTP(S).

Is there any way to access parent TElSimpleSSLClient in ElHTTPSClient so we can use functionality of it?

Quote

I can hardly imagine such situation and I think that in this case you need create and parse HTTP requests/responses yourself.

I know that we can solve it like that if only we can send data.
I actually can do this with Indy where it's provides access to all parent classes such as
TIdContext->TIdTCPConnection. When we do GET method connection is then established,
server part didn't close it, and we can use all TIdTCPConnection functionality to send data.
But you say ElHTTPSClient and TElSimpleSSLClient are blocking...

Quote

SimpleSSLClient (and ElHTTPSClient consequently) works in blocking mode, so you would need to run it within a thread.

I thought wrong that there is some internal threading stuff in SBB like in Indy. I began with demo application with non-blocking mode, now I see its based on VCL sockets.

We use cookies to help provide you with the best possible online experience. By using this site, you agree that we may store and access cookies on your device. You can find out more about and set your own preferences here.