Standards (TLS)

XKCD tried to explain a bit about standards...

But there are some other aspects, even when you have good, single, consistent standards the challenge can be implementations.

My fun today revolved around TLS and https.

So, the way it is meant to work, is when we close a connection, we send a TLS level close alert, and the other end sends us one, and then we close the TCP connection underneath. This is pretty simple and works for almost all connections...


Testing Edge on MS Windows 10. Some of the pages on the FireBrick are dynamic and so work on a Connection: close basis. This means, instead of a Content-Length at the start, the data in the page is sent until the connection is closed.

For http this is simple, we close the TCP at the end, job done.

For https it should be simple, we do a TLS close message, we should get one back and then close TCP, but no... We get no reply to the TLS level close, and TCP stays open. The web browser shows the page not completely loaded, and so the onLoad javascript does not run and all sorts of other nasty side effects, WTF?!

The fix is not too hard, a half close on tx side to send a FIN after the TLS level close, allowing far end to send a TLS close back or just close at TCP level (which is what Edge does).

But it has taken three engineers several hours of work today to diagnose and work around this. Arrrg!

What is also fun is we find Edge appears to do a sort of speculative connection. If it does not have a clean keep-alive session it makes a new connection when it has nothing to say, just in case. This was causing exception handling our side (as we expect a prompt request when we get a connection) which also closed TLS uncleanly and impacted session resumption. We have had to make changes for that too.

The good news, after all that, is we now work with Edge (we already worked with pretty much everything else), so should finally have the new https code release this evening at some point. Watch this space.

I have to say, and this is all down to Cliff, that the https is really surprisingly snappy and responsive. One customer said he could swear it was faster than http, which makes no sense. I am quite impressed.


  1. There is someone who uses Edge? Never realised that.

    1. Microsoft says that Edge is the fastest browser ever. Apparently it is 10% faster than Chrome.

  2. Huh! I use it all the time, no proble

  3. What - Microsoft not bothering to implement things properly to a standard? That must be a first.

    1. Hold on a minute. What about Silverlight? That Silverlight thing was worse than Flash but Microsoft still rolled it out then discontinued it.

  4. I had a funny bug with Safari and haproxy TLS termination recently.


  5. Speaking of unusual standards...

    How is the SCTP support on Firebricks? We need this for certain 4G cells etc.

  6. If you use chunked encoding (which is standard in HTTP/1.1) you don't need Connection: Close for things that you can't add a Content-Length header to.

    And speculative connections is standard - pretty much all browsers do it (they are a bit of a pain for us because our audit logs can't differentiate between unused speculative connections and failed TLS handshakes...)

    1. Indeed. The current design does not allow for chunked, but that is something we are looking at anyway.

    2. The extra fun bit is HTTP/2.0 which allows connection reuse even when you're requesting something from a different domain (the UA checks that both domains resolve to the same IP addresses and that the certificate for the established connection covers the new domain).

  7. There used to be a site called or stole my life, recording the amount of time wasted changing perfectly good code just so it would work on ie. Sadly this appears to have gone but perhaps there are grounds for an edge stole my life site?


Comments are moderated purely to filter out obvious spam, but it means they may not show immediately.

TOTSCO - the top level - ordering

This should give you some idea of the issues with a simple matter of providing a broadband service. Bear in mind the broadband service may h...