iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
⚒️

msquic on Linux

に公開

There are various QUIC implementations.

I tried building & testing msquic among them.

While I could pass the tests easily on Windows 10 and Mac (Big Sur) (*), I struggled with Linux, which is my target platform. In conclusion, I couldn't fully resolve the hundreds of errors that occurred on CentOS 8, but I was able to pass the tests on Ubuntu 18.04 as smoothly as on Windows or Mac.

(*) The following four tests, which use the "not yet supported" function CxPlatGetTestCertificate starting from line 431 of src/platform/selfsign_openssl.c, will fail (this is unavoidable).

  • CredValidation.ConnectExpiredClientCertificate
  • CredValidation.ConnectExpiredServerCertificate
  • CredValidation.ConnectValidClientCertificate
  • CredValidation.ConnectValidServerCertificate

Installing Ubuntu

I installed Ubuntu on Hyper-V, referring to Installing Ubuntu 18.04 LTS on Windows 10 Pro Hyper-V.

It might work on WSL as well, but I installed it on Hyper-V because I wanted to match the conditions with CentOS, which I had previously tested on Hyper-V.

The ISO I used was 18.04.5-desktop-amd64.

I think it is better to choose version 18.04, which appears in the msquic build instructions. Even if you want to challenge other versions, those supported by dotnet, such as 21.04 or 20.04, would be preferable.

Note that I selected the standard installation (not the minimal installation; this doesn't really matter as it can be adjusted after installation anyway).

Building msquic

Although it is described in the official documentation, I have listed the execution steps below so that you do not have to refer to multiple pages.

Clone the repository

$ sudo apt install git
$ git clone https://github.com/microsoft/msquic.git
$ cd msquic/
$ git submodule update --init --recursive

Install CMake (>= 3.16)

You cannot satisfy the requirement of CMake >= 3.16 without adding an external repository. As stated in the official instructions, follow the steps at https://apt.kitware.com/ to install it.

$ wget -q https://apt.kitware.com/kitware-archive.sh
$ chmod 755 kitware-archive.sh 
$ sudo ./kitware-archive.sh 
$ sudo apt-get install -y cmake

Install PowerShell and .NET

$ wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb
$ sudo dpkg -i packages-microsoft-prod.deb 
$ sudo apt-get update
$ sudo add-apt-repository universe
$ sudo apt-get install -y powershell
$ sudo apt-get update
$ sudo apt-get install -y apt-transport-https
$ sudo apt-get update
$ sudo apt-get install -y dotnet-sdk-5.0

Build

$ pwsh
PS > ./scripts/prepare-machine.ps1 -Configuration Dev
PS > ./scripts/build.ps1 -Tls openssl

Test

PS > ./scripts/test.ps1 -Tls openssl

Extras

List all test cases (without executing)

PS > ./scripts/test.ps1 -Tls openssl -ListTestCases

Exclude test cases

To exclude TlsTest.HandshakeCertFromFile, use the following command:

PS > ./scripts/test.ps1 -Tls openssl -Filter *-TlsTest.HandshakeCertFromFile

Discussion