Skip to main content

HTTP mode: Connect using cURL

Important

To use cURL to connect to a running s_server, make sure you started an s_server in HTTP mode. See Start a server in HTTP mode.

With an active demo server running in HTTP mode in one of your terminal windows, you first need to open a new terminal window. In the new window, start another bash session with docker-compose exec.

cd [path/to/dir/]digicert-pqc-docker
docker-compose exec pqc /bin/bash

Now, connect to the running server using cURL. The demo certificates you generated are self-signed and will raise an untrusted certificate warning. To ignore these warnings, you must include the -k switch.

curl -k https://digicert.pqc/demo.html

You'll see this output:

<html>
<head></head>
<body>
  <h1>Hello world! PQC FUTURE IS HERE!</h1>
</body>
</html>

In your other terminal window with the active s_server running, you'll see this output:

read from 0x556d44ced1e0 [0x556d44cf61a3] (5 bytes => 5 (0x5))
0000 - 16 03 01 02 00                                    .....
read from 0x556d44ced1e0 [0x556d44cf61a8] (512 bytes => 512 (0x200))
0000 - 01 00 01 fc 03 03 a3 d2-a7 5e 12 44 88 93 78 fd   .........^.D..x.
[...]
write to 0x556d44ced1e0 [0x556d44d05120] (94 bytes => 94 (0x5E))
0000 - 16 03 03 00 59 02 00 00-55 03 03 36 a7 a4 2d 57   ....Y...U..6..-W
[...]
write to 0x556d44ced1e0 [0x556d44cffc53] (4954 bytes => 4954 (0x135A))
0000 - 16 03 03 13 55 0b 00 13-51 00 13 4e 00 13 4b 30   ....U...Q..N..K0
[...]
write to 0x556d44ced1e0 [0x556d44d05120] (220 bytes => 220 (0xDC))
0000 - 16 03 03 00 d7 0c 00 00-d3 03 00 17 41 04 5a 06   ............A.Z.
[...]
write to 0x556d44ced1e0 [0x556d44d05120] (9 bytes => 9 (0x9))
0000 - 16 03 03 00 04 0e 00 00-00                        .........
read from 0x556d44ced1e0 [0x556d44cf61a3] (5 bytes => 5 (0x5))
0000 - 16 03 03 00 46                                    ....F
read from 0x556d44ced1e0 [0x556d44cf61a8] (70 bytes => 70 (0x46))
0000 - 10 00 00 42 41 04 c3 ce-7a a8 53 76 28 fc 55 c5   ...BA...z.Sv(.U.
[...]
0040 - 6b c7 1a 5e f5 0e                                 k..^..
read from 0x556d44ced1e0 [0x556d44cf61a3] (5 bytes => 5 (0x5))
0000 - 14 03 03 00 01                                    .....
read from 0x556d44ced1e0 [0x556d44cf61a8] (1 bytes => 1 (0x1))
0000 - 01                                                .
read from 0x556d44ced1e0 [0x556d44cf61a3] (5 bytes => 5 (0x5))
0000 - 16 03 03 00 28                                    ....(
read from 0x556d44ced1e0 [0x556d44cf61a8] (40 bytes => 40 (0x28))
0000 - 77 07 27 75 71 54 a9 bc-89 2f 69 df 45 6a 6c d8   w.'uqT.../i.Ejl.
[...]
write to 0x556d44ced1e0 [0x556d44d05120] (6 bytes => 6 (0x6))
0000 - 14 03 03 00 01 01                                 ......
write to 0x556d44ced1e0 [0x556d44d05120] (45 bytes => 45 (0x2D))
0000 - 16 03 03 00 28 78 f8 92-c1 cd d0 73 6b 72 6e 4c   ....(x.....skrnL
[...]
read from 0x556d44ced1e0 [0x556d44cf61a3] (5 bytes => 5 (0x5))
0000 - 17 03 03 00 6d                                    ....m
read from 0x556d44ced1e0 [0x556d44cf61a8] (109 bytes => 109 (0x6D))
0000 - 77 07 27 75 71 54 a9 bd-0c 8f e3 9c f3 90 35 a1   w.'uqT........5.
[...]
FILE:demo.html
write to 0x556d44ced1e0 [0x556d44cffc53] (117 bytes => 117 (0x75))
0000 - 17 03 03 00 70 78 f8 92-c1 cd d0 73 6c 14 de 14   ....px.....sl...
[...]
ACCEPT

Congratulations! You've successfully set up and tested your PQC dockerized toolkit environment. You can now create certificates and establish quantum-safe connections.