EldoS | Feel safer!

Software components for data protection, secure storage and transfer

How do i setup local IP and asp.net for SecureBlackbox

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.
Posted: 12/27/2014 21:16:27
by Lex Dean (Basic support level)
Joined: 12/25/2014
Posts: 8

Please for give me I'm learning,
Question: - How do I setup local IP and asp.net for SecureBlackbox HTTPS Server

Do I need to setup an ActiveX Server first
1) Open Delphi
2) Click File|New…
3) Select the ActiveX tab and click the ActiveX Library icon.
4) Again click the File|New… menu.
5) Select the ActiveX tab and click the Active Server Object icon.

Then add a ElHTTPSServer
Or is their a better way to do this

And when I have a server

Then replace ActiveX with code like this to give me a local server address: -
httpClient = new SBHTTPSClient.TElHTTPSClient();
httpClient.MaxRedirections = 0;
httpClient.SocketTimeout = 10000;
httpClient.PreferKeepAlive = true;

httpClient.LocalAddress = "";
httpClient.LocalPort = currentPort;

httpClient.SocketBinding.LocalIntfAddress = "";
httpClient.SocketBinding.Port = currentPort;

J Lex Dean
Posted: 12/28/2014 00:37:47
by Eugene Mayevski (Team)

ActiveX stuff you've described is not about network servers at all but about ActiveX technology which operates the term of "server" as well.

TElHTTPSServer is a standalone component, it doesn't need ASP.NET or any ActiveX.

TElHTTPSServer, being a low-level component, doesn't deal with network itself. The server-side socket component is created separately in your code. Please refer to the sample project in <SecureBlackbox>\Samples\C#\HTTPBlackbox\Server folder for example.

If you need to get the local IP, you get it from your socket component, not from the server. And in any case I don't understand the purpose of your httpClient code.

On a side note please use CODE button to mark the beginning and the end of the code blocks in your messages.

Sincerely yours
Eugene Mayevski
Posted: 12/29/2014 19:51:05
by Lex Dean (Basic support level)
Joined: 12/25/2014
Posts: 8

that makes sense thanks
I fully understand the need of getting a IP address from my ISP provider
that's basic.
I fully get TForm1.OnRequest

I'm sorry I'm still learning some basics
I'm very interested in: -
1/ does all requests come in as separate threads.
2/ I cannot find how to separate send/receive of data as HTTPS/HTTP to offer security were needed and save processing time. Do I call a procedure to send a requested page back to a client/user to manage this.
3/ The example does not show any ASP.Net support, is it the same as the Delphi HTTP server.

thanks in advance
Posted: 12/30/2014 00:00:22
by Eugene Mayevski (Team)

The questions are more or less inapplicable because the architecture of the component is different from what you possibly imagine.

TElHTTPSServer is a data processor class which receives incoming data (no matter from where they come), assumes they are the HTTP request, parses such request and fires the corresponding method. Then it prepares the HTTP response and emits it and your response data (again no matter what transport you use).

TElHTTPSServer works within single thread and handles exactly one logical connection with the client (in case of persistent HTTP connections it can be several requests going within one connection).

TElHTTPSServer unlike for example TElSimpleFTPSServer is NOT an all-in-one component which you drop to the form and have a fully working server.

In particular it's you who implement socket code. HTTPS is defined by utilizing TLS and by performing TLS handshake before the HTTP request is sent. So TLS and socket stuff are separate from TElHTTPSServer . You can implement them with SecureBlackbox classes as well (TElSocket + TElSSLServer) or by other means, possibly not even socket-based.

ASP.NET is barely related to the component as ASP.NET works when the request is already parsed by the server and in this case there's nothing left for TElHTTPSServer to do.

Sincerely yours
Eugene Mayevski
Posted: 12/30/2014 03:49:42
by Lex Dean (Basic support level)
Joined: 12/25/2014
Posts: 8

That's a lot of new components to take in
Pic included is I believe is my base components

My goal is to produce a purchasing/shopping web site that uses a shopping basket
and enables the purchase at the end.

1/ TElHTTPSServer has a single thread is because little data travels through TElHTTPSServer. Example only use TElHTTPSServer for pages that are required for the final purchase.
2/ Do I need to include ElX509CertificateEx and the ElCookieManager to identify my client. Use the ElCookieManager to identify the user when completing a 'GET' request and deliver a page appropriately.
3/ Should I be asking questions of any potential conflicts between my selected objects in my basic object selection.

Posted: 12/30/2014 04:02:17
by Eugene Mayevski (Team)

Lex Dean wrote:
My goal is to produce a purchasing/shopping web site that uses a shopping basket and enables the purchase at the end.

Before we go any further, can you please explain why you decided to implement the needed functionality with TElHTTPSServer?

If I were to address such problem, I would
1) look at existing CMS (Content Management Systems) many of which includes shopping carts. There exist several CMS written in .NET (Composite C1, Orchard, DotNetNuke to name a few).
2) Look at running an IIS server with ASP.NET technology. You would write ASP.NET web pages in .NET. This technology is self-containing and doesn't require running a custom HTTP server.

TElHTTPSServer component is a low-level component that requires skills, time, and, most of all, reasons and motivation to use. I.e. you need to *require* it, then it makes sense. Your task doesn't seem to require such low-level components unless you really need to implement the server from scratch and not use IIS and ASP.NET (for example for learning purposes).

To answer why TElHTTPSServer is offered, I need to mention WebDAV technology and many cases when deployment of full-scale server goes beyond the needs or capabilities (running on low-power hardware with little resources, custom platforms like Windows CE or Android etc.).

Sincerely yours
Eugene Mayevski
Posted: 12/31/2014 16:13:54
by Lex Dean (Basic support level)
Joined: 12/25/2014
Posts: 8

I have a very different web site idea that has never been done before and it needs a very secure system to do it. Security is key.
If I could access a TElHTTPSServer type server that was multi thread of some type
it would be good enough.
where things stand at the moment: -
I'm thinking of making an adverting web site and using WebSnap in an application
to deliver secure pages with my own security method.

This looks to be my only option
Posted: 01/01/2015 00:29:16
by Eugene Mayevski (Team)

Understood. Ok. In this case here's what we have:

TElHTTPSServer is a low-level class which handles one logical connection. To make a server you need
1) a simple socket server class which run a server socket can accept incoming connections and spawn worker threads. Server socket can be implemented with TElSocket class. You would need separate sockets listening on different ports for secure and non-secure HTTP connections (this is the way HTTPS works - you must have HTTP and HTTPS on different ports).
2) Worker thread class which handles the TCP connection via the accepted socket, receives the requests via that socket and sends back responses. This thread class is what you write. It creates and uses an instance of TElHTTPSServer for HTTP operations and an instance of TElSSLServer class for optional TLS layer.

Worker threads can be "pooled" (created beforehand and not destroyed but reused for later connections) but you always have a separate worker thread for one connection.

Our sample project illustrates this architecture but it should not be used as is in your actual application - the sample was not designed for production use.

Sincerely yours
Eugene Mayevski
Posted: 01/04/2015 02:51:09
by Lex Dean (Basic support level)
Joined: 12/25/2014
Posts: 8

Separate HTTP server and HTTPS server (identical multi thread) is ideal to manage at our level, that's easy to handle. But making up multi threading objects is a bit of work with TCollection etc. Anyway I thought that's what we pay you for.
May be HTTP server has everything you need to relate over.
You must have done this before:-
Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.



Topic viewed 4851 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!