{"id":11951,"date":"2019-01-21T14:44:14","date_gmt":"2019-01-21T13:44:14","guid":{"rendered":"https:\/\/daniel.haxx.se\/blog\/?p=11951"},"modified":"2019-01-21T14:44:14","modified_gmt":"2019-01-21T13:44:14","slug":"quic-and-missing-apis","status":"publish","type":"post","link":"https:\/\/daniel.haxx.se\/blog\/2019\/01\/21\/quic-and-missing-apis\/","title":{"rendered":"QUIC and missing APIs"},"content":{"rendered":"\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img loading=\"lazy\" decoding=\"async\" width=\"450\" height=\"393\" src=\"https:\/\/daniel.haxx.se\/blog\/wp-content\/uploads\/2017\/06\/QUIC-450x393.png\" alt=\"\" class=\"wp-image-10108\" srcset=\"https:\/\/daniel.haxx.se\/blog\/wp-content\/uploads\/2017\/06\/QUIC-450x393.png 450w, https:\/\/daniel.haxx.se\/blog\/wp-content\/uploads\/2017\/06\/QUIC-200x175.png 200w, https:\/\/daniel.haxx.se\/blog\/wp-content\/uploads\/2017\/06\/QUIC-768x671.png 768w, https:\/\/daniel.haxx.se\/blog\/wp-content\/uploads\/2017\/06\/QUIC-1200x1048.png 1200w, https:\/\/daniel.haxx.se\/blog\/wp-content\/uploads\/2017\/06\/QUIC.png 2000w\" sizes=\"auto, (max-width: 450px) 100vw, 450px\" \/><\/figure><\/div>\n\n\n\n<p>I trust you&#8217;ve heard by now that <a href=\"https:\/\/daniel.haxx.se\/blog\/2018\/11\/26\/http3-explained\/\">HTTP\/3<\/a> is coming. It is the next destined HTTP version, targeted to get published as an RFC in July 2019. Not very far off.<\/p>\n\n\n\n<p>HTTP\/3 will not be done over TCP. It will only be performed over <a href=\"https:\/\/quicwg.org\/\">QUIC<\/a>, which is a transport protocol replacement for TCP that <strong>always<\/strong> is done encrypted. There&#8217;s no clear-text version of QUIC.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">TLS 1.3<\/h2>\n\n\n\n<p>The <a href=\"https:\/\/tools.ietf.org\/html\/draft-ietf-quic-tls-17\">encryption in QUIC<\/a> is based on TLS 1.3 technologies which I believe everyone thinks is a good idea and generally the correct decision. We need to successively raise the bar as we move forward with protocols.<\/p>\n\n\n\n<p>However, QUIC is not only a transport protocol that does encryption by itself while TLS is typically (and designed as) a protocol that is done on top of TCP, it was also designed by a team of engineers who came up with a design that requires APIs from the TLS layer that the traditional TLS over TCP use case doesn&#8217;t need!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">New TLS APIs<\/h2>\n\n\n\n<p>A QUIC implementation needs to extract traffic secrets from the TLS connection and it needs to be able to read\/write TLS messages directly &#8211; not using the TLS record layer. TLS records are what&#8217;s used when we send TLS over TCP. (This was discussed and decided back around the time for the <a href=\"https:\/\/daniel.haxx.se\/blog\/2018\/06\/08\/quic-wg-interim-kista\/\">QUIC interim in Kista<\/a>.)<\/p>\n\n\n\n<p>These operations need APIs that still are missing in for example the very popular <strong>OpenSSL<\/strong> library, but also in other commonly used ones like <strong>GnuTLS<\/strong> and <strong>libressl<\/strong>. And of course <strong>schannel<\/strong> and <strong>Secure Transport<\/strong>.<\/p>\n\n\n\n<p>Libraries known to already have done the job and expose the necessary mechanisms include BoringSSL, NSS, quicly, PicoTLS and Minq. All of those are incidentally TLS libraries with a more limited number of application users and less mainstream. They&#8217;re also more or less developed by people who are also actively engaged in the QUIC protocol development.<\/p>\n\n\n\n<p>The <a href=\"https:\/\/github.com\/quicwg\/base-drafts\/wiki\/Implementations\">QUIC libraries in progress<\/a> now are typically using either one of the TLS libraries that already are adapted or do what <a href=\"https:\/\/github.com\/ngtcp2\/ngtcp2\">ngtcp2<\/a> does: it hosts a <a href=\"https:\/\/github.com\/tatsuhiro-t\/openssl\/tree\/quic-draft-17\">custom-patched version of OpenSSL<\/a> that brings the needed functionality.<\/p>\n\n\n\n<p><a href=\"https:\/\/mta.openssl.org\/pipermail\/openssl-dev\/2017-September\/009713.html\">Matt Caswell of the OpenSSL development team acknowledged this situation<\/a> already back in September 2017, but so far we haven&#8217;t seen this result in updated code shipped in a released version.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">curl and QUIC<\/h2>\n\n\n\n<p>curl is TLS library agnostic and can get built with around 12 different TLS libraries &#8211; one or many actually, as you can build it to allow users to select TLS backend in run-time!<\/p>\n\n\n\n<p>OpenSSL is without competition the most popular choice to build curl with outside of the proprietary operating systems like macOS and Windows 10. But even the vendor-build and provided mac and Windows versions are <em>also<\/em> built with libraries that lack APIs for this.<\/p>\n\n\n\n<p>With our current <a href=\"https:\/\/github.com\/curl\/curl\/pull\/3314\">keen interest<\/a> in QUIC and HTTP\/3 support for curl, we&#8217;re about to run into an interesting TLS situation. How exactly is someone going to build curl to simultaneously support both traditional TLS based protocols as well as QUIC going forward?<\/p>\n\n\n\n<p>I don&#8217;t have a good answer to this yet. Right now (assuming we would have the code ready in our end, which we don&#8217;t), we can&#8217;t ship QUIC or HTTP\/3 support enabled for curl built to use the most popular TLS libraries! Hopefully by the time we get our code in order, the situation has improved somewhat.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">This will slow down QUIC deployment<\/h2>\n\n\n\n<p>I&#8217;m personally convinced that this little API problem will be friction enough when going forward that it will slow down and hinder QUIC deployment at least initially.<\/p>\n\n\n\n<p>When the <a href=\"https:\/\/daniel.haxx.se\/blog\/2015\/05\/15\/rfc-7540-is-http2\/\">HTTP\/2 spec shipped in May 2015<\/a>, it introduced a dependency on the fairly new TLS extension called ALPN that for a long time caused head aches for server admins since ALPN wasn&#8217;t supported in the OpenSSL versions that was typically installed and used at the time, but you had to upgrade OpenSSL to version 1.0.2 to get that supported.<\/p>\n\n\n\n<p>At that time, almost four years ago, OpenSSL 1.0.2 was already released and the problem was big enough to just <em>upgrade<\/em> to that. This time, the API we&#8217;re discussing here is not even in a beta version of OpenSSL and thus hasn&#8217;t been released in <em>any<\/em> version yet. That&#8217;s far worse than the HTTP\/2 situation we had and that took a few years to ride out.<\/p>\n\n\n\n<p>Will we get these APIs into an OpenSSL release to test before the QUIC specification is done? If the schedule sticks, there&#8217;s about six months left&#8230;<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I trust you&#8217;ve heard by now that HTTP\/3 is coming. It is the next destined HTTP version, targeted to get published as an RFC in July 2019. Not very far off. HTTP\/3 will not be done over TCP. It will only be performed over QUIC, which is a transport protocol replacement for TCP that always &hellip; <a href=\"https:\/\/daniel.haxx.se\/blog\/2019\/01\/21\/quic-and-missing-apis\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">QUIC and missing APIs<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":5,"featured_media":11958,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,13,133],"tags":[371,392,33,436,193,414,381],"class_list":["post-11951","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-curl","category-net","category-security","tag-api","tag-boringssl","tag-curl-and-libcurl","tag-http3","tag-openssl","tag-quic","tag-tls"],"_links":{"self":[{"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/posts\/11951","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/comments?post=11951"}],"version-history":[{"count":9,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/posts\/11951\/revisions"}],"predecessor-version":[{"id":11962,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/posts\/11951\/revisions\/11962"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/media\/11958"}],"wp:attachment":[{"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/media?parent=11951"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/categories?post=11951"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/daniel.haxx.se\/blog\/wp-json\/wp\/v2\/tags?post=11951"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}