
AlbertL (Customer) asked a question.
HTTPCMD execution times when using SSL/TLS?
Just wondering what sort of timings people are seeing when using HTTPCMD with SSL/TLS. When pushing a few hundred bytes to a server on a shared hosting service, I'm seeing total execution times (from triggering the HTTPCMD instruction to receiving a response from the server) roughly in the range of 8-14 seconds, with the average being toward the low end. When running the same program to the same server with straight HTTP, I usually see timings under 1 second.
That's what it takes. TLS handshakes are very computationally intensive. We have actually built a prototype of a new CPU with dedicated crypto hardware, but parts are unavailable to build it. When the world gets back to normal, we’ll finish it.
Thanks for the quick reply (unlike mine!). TLS hardware would indeed be a fantastic addition to the BRX, making it competitive in even more applications. In the meantime, I'm wondering if anyone makes an outboard "black box" HTTP-HTTPS converter/gateway/router/whatever that would sit between the PLC and the internet, performing the crypto tasks to provide two-way transparent pass-through. I've searched but can't find anything like that.
I had multiple similar challenges and ended up dedicating a Win10 PC to act as a gateway for our BRX. The PC is running IIS for two-way communication with the BRX. The BRX polls the PC using HTTPCMD asking for it to hit some external server. Data from those sources is then returned to the BRX via JSON. I am typically seeing 0.2-second transfers in both directions.
IIS by itself does have a REDIRECT function available through scripting. This is commonly used to redirect incoming HTTP hits to HTTPS within the same domain. However, there is no reason the outgoing domain couldn't be hardcoded to your ultimate destination. If you are only sending data one way (i.e. BRX to an external host), that might work.
Thanks, Bob. That approach worked - I ended up using a Raspberry Pi (per suggestion here: https://www.plctalk.net/qanda/showthread.php?t=132302) running Apache and a few lines of PHP code. It was very easy to set up.
Note that I've posted my proxy server code in PHP for the Raspberry Pi in the above thread on PLCtalk. Another person had earlier posted a Python version.
Just following up - is the new CPU still in the works?
Just following up on this - is there any news about a CPU with built-in crypto hardware?
Post-covid conditions steered emphasis toward items that enhanced existing hardware.
$TLSTimeslice (DST68) was added during this period. It allows you to give the CPU more time per scan to do the SSL/TLS encryption processing.
You can allot more time per plc scan by tweaking DST68 ($TLSTimeSlice). I'm pretty sure it's in MICROseconds. Not sure of the default value, but try 200 or 400 for a slight hit on PLC scan (additional 0.2ms to 0.4ms), but it may speed it up calendar-wise (i.e. 8-14 seconds may be cut in half?)
Thanks - and sorry for another slow reply! I'll give that a try.