Delphi HTTPS/SSL server example?

I need to write a server that uses https (SSL) for client connections. I cannot see an example in the Delphi samples on how to do this. The help for most of the http channels is empty.

I aim to have RO SDK clients, and also mobile devices using normal POST/GET type actions. The JSON support looks sensible.

I would appreciate some pointers on what to do to make it all work. I’ve floundered for a few hours unable to find a guide, or to make it work. For example, there appears to be no documentation of the TargetURL property. Should that include the /JSON or not? And where do I get the openssl dll that is mentioned elsewhere? Searching here for “ssl” gets zero posts, which seems odd given how many there are.

Fundamentally, I’m hoping that RO SDK will be a useful solution for my problem. At the moment, I can’t see how to get it working.

Hi,

bnx2012 said: TargetURL property. Should that include the /JSON or not?
, yes, the TargetURL needs to be the full address to the server, including the message endpoint (you could potentially have more than one message, configured, spo some clients might connect to http://yourserver.com:8099/bin and others to http://yourserver.com:8099/json.
bnx2012 said: And where do I get the openssl dll that is mentioned elsewhere?
Unfortunately, Indy makes OpenSSL a it tricky. you can find the DLLs at http://www.indyproject.org/sockets/download/files/indy8.en.aspx

fwiw, we are working on making SSL servers much easier to set up, for the next release.

I look forward to a clear instruction on what to do to make it all easier. It will be a clear advantage in the RO SDK if you do. The links you point to don’t say what you have to do to actually make it work. A step by step guide is needed: “Download files”, “Copy these three files to your app directory”, “In your Delphi project, do this”. I look forward to the next update, as this is critical to my current project.

Hi.

Here are some instructions how to setup SLL for Indy based server or channel:
For client add TIdSSLIOHandlerSocketOpenSSL component and set it to TROIndyHTTPChannel.IndyClient.IOHandler.
For server add TIdServerIOHandlerSSLOpenSSL component and set it to TROIndyHTTPServer.IndyServer.IOHandler.
You’ll need certificate and key files and assign it names to SSLOptions SertFile and KeyFile properties of IOHandler.
You can read more about this here:

http://www.openssl.org/docs/HOWTO/
http://www.akadia.com/services/ssh_test_certificate.html

Also you can use commercial solutions as StrSecII or SecureBlackBox which can do proper validation.

And they said it wasn’t easy! :sunglasses:

Okay, the info here, and the sample at http://connect.remobjects.com/discussion/580/ro-sdk-indy-server-ssl-sample have sorted it for me.

The only issue I have is that the HTML returned for the human readable text is using http links, and not https links, but that is so minor I don’t care.

hm, what HTML? our “welcome” page? that should have all relative links…

hm, what HTML? our "welcome" page? that should have all relative links...

Yes, they are relative, but they are http links, and not https links which the server is operating on. If I edit the URL to add the ‘s’ in the browser, they work. It is a minor thing.

hmm. how can relative links be “http”? if the link is, say “./bin”, then it’s up to the browser to expand that to the proper http or https link based on the current page’s address? can you give me a concrete example where you see this not work?