Skip to main content

The secret message hidden in every HTTP/2 connection

If you spy on an HTTP/2 connection starting up you'll notice that it sends an almost-but-not-quite valid HTTP request at the very start of the connection. Like this:

Written a little more clearly that's:

    PRI * HTTP2.0


The HTTP verb is PRI and the body contains just SM. Put them together and you get... PRISM. This occurs right at the start of the connection to ensure that the server really supports HTTP/2.0. It is detailed in Section 3.5 of RFC7540 as follows:

   In HTTP/2, each endpoint is required to send a connection preface as
   a final confirmation of the protocol in use and to establish the
   initial settings for the HTTP/2 connection.  The client and server
   each send a different connection preface.

   The client connection preface starts with a sequence of 24 octets,
   which in hex notation is:


   That is, the connection preface starts with the string "PRI *

I tried to find an explanation of the specific letters used and why they spell PRISM. After a bit of spelunking the following comes to light.

May 29, 2013
IETF draft-ietf-httpbis-http2-03 describes this connection mechanism and indicates that the string to send is FOO * HTTP/2.0\r\n\r\nBA\r\n\r\n.

July 8, 2013
IETF draft-ietf-httpbis-http2-04 changes the string to PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n.


I wonder what happened between May 29, 2013 and July 8, 2013? Could it be "U.S., British intelligence mining data from nine U.S. Internet companies in broad secret program"?

Thanks to this comment on Hacker News here's the actual commit that introduced this change. On June 14, 2013 the string was changed with the comment "Exercising editorial discretion regarding magic."


Chester said…
Interesting. It seems to have been noticed before in - you can Google Translate and search for "PRI SM" that they notice the pun to be related to the (then) recent Snowden disclosure, emphasizing its provisory aspect (it may be anything that is *not* valid non-HTTP/2 server) and even dismisses further discussion on that as "bikeshedding". Since provisory names tend to stick, I will not be surprised if this indeed becomes the norm...
mnot said…
We needed two pseudo-HTTP requests for the "magic" to assure it wasn't being interpreted as HTTP/1; I'd done runs across something like 2% of the HTTP servers on the Internet and found that that form failed most reliably.

In the SF meeting at Twitter HQ, we were trying to nail this down; see Originally, we were looking at "STA" and "RT .

However, PRISM had just broken, and it was all that was being discussed in the hallway. People were pissed. It didn't get into the minutes, but it came up as an idea to replace START since it had five letters, and people were unlikely to every want a "PRI" or "SM" method.

Since this was effectively a bikeshed painting exercise, we let Martin determine the result using editorial discretion; although it doesn't get into the minutes, it was pretty clear that people were OK with this (since it was split into two, it was pretty harmless anyway).

Later, over dinner at the Zurich F2F, a number of people thought it would be good to replace "GOAWAY" with "GTFO" (after WAY too much fondue). That application of editorial discretion go so well in the end.

This is all from my quite fallible memory, YMMV.
Matty K said…
Everyone knows Martin is Illuminati, why else would he be allowed on the internet with that accent?

But more seriously, I had a bit of a whinge on my blog around that time wherein I compared it to a crude phallic graffito scrawled on the side of a bike shed. I ended with:

But I can't complain, because that would be "bike shedding." Surely there must come a point where the colour of the shed is important. Trivial details in a spec are still details in the spec, and this one is part of a MUST-level interop requirement, so absolutely everyone who implements or interacts with HTTP/2 is going to have to reproduce (or at least look at) that c**k-and-balls every time they delve into the spec.

So, a question: do bike-shedding details ever become important? And if so, when?

No one ever answered, so I still don't know.

Popular posts from this blog

How to write a successful blog post

First, a quick clarification of 'successful'. In this instance, I mean a blog post that receives a large number of page views. For my, little blog the most successful post ever got almost 57,000 page views. Not a lot by some other standards, but I was pretty happy about it. Looking at the top 10 blog posts (by page views) on my site, I've tried to distill some wisdom about what made them successful. Your blog posting mileage may vary. 1. Avoid using the passive voice The Microsoft Word grammar checker has probably been telling you this for years, but the passive voice excludes the people involved in your blog post. And that includes you, the author, and the reader. By using personal pronouns like I, you and we, you will include the reader in your blog post. When I first started this blog I avoid using "I" because I thought I was being narcissistic. But we all like to read about other people, people help anchor a story in reality. Without people your bl

Your last name contains invalid characters

My last name is "Graham-Cumming". But here's a typical form response when I enter it: Does the web site have any idea how rude it is to claim that my last name contains invalid characters? Clearly not. What they actually meant is: our web site will not accept that hyphen in your last name. But do they say that? No, of course not. They decide to shove in my face the claim that there's something wrong with my name. There's nothing wrong with my name, just as there's nothing wrong with someone whose first name is Jean-Marie, or someone whose last name is O'Reilly. What is wrong is that way this is being handled. If the system can't cope with non-letters and spaces it needs to say that. How about the following error message: Our system is unable to process last names that contain non-letters, please replace them with spaces. Don't blame me for having a last name that your system doesn't like, whose fault is that? Saying "Your

The Elevator Button Problem

User interface design is hard. It's hard because people perceive apparently simple things very differently. For example, take a look at this interface to an elevator: From flickr Now imagine the following situation. You are on the third floor of this building and you wish to go to the tenth. The elevator is on the fifth floor and there's an indicator that tells you where it is. Which button do you press? Most people probably say: "press up" since they want to go up. Not long ago I watched someone do the opposite and questioned them about their behavior. They said: "well the elevator is on the fifth floor and I am on the third, so I want it to come down to me". Much can be learnt about the design of user interfaces by considering this, apparently, simple interface. If you think about the elevator button problem you'll find that something so simple has hidden depths. How do people learn about elevator calling? What's the right amount of