xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame] | 1 | <testcase> |
| 2 | <info> |
| 3 | <keywords> |
| 4 | HTTP |
| 5 | HTTP GET |
| 6 | DOH |
| 7 | </keywords> |
| 8 | </info> |
| 9 | |
| 10 | # |
| 11 | # Server-side |
| 12 | <reply> |
| 13 | |
| 14 | # This is the DoH response for foo.example.com A 127.0.0.1. This requires that |
| 15 | # the test server is accessible at that address! |
| 16 | |
| 17 | <data1 base64="yes"> |
| 18 | SFRUUC8xLjEgMjAwIE9LCkRhdGU6IFRodSwgMDkgTm92IDIwMTAgMTQ6NDk6MDAgR01UClNlcnZl |
| 19 | cjogdGVzdC1zZXJ2ZXIvZmFrZQpDb25uZWN0aW9uOiBjbG9zZQpDb250ZW50LVR5cGU6IGFwcGxp |
| 20 | Y2F0aW9uL2Rucy1tZXNzYWdlCkNvbnRlbnQtTGVuZ3RoOiA0OQoKAAABAAABAAEAAAAAA2Zvbwdl |
| 21 | eGFtcGxlA2NvbQAAAQABwAwAAQABAAAANwAEfwAAAQ== |
| 22 | </data1> |
| 23 | <data> |
| 24 | HTTP/1.1 200 OK |
| 25 | Date: Tue, 09 Nov 2010 14:49:00 GMT |
| 26 | Server: test-server/fake |
| 27 | Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT |
| 28 | ETag: "21025-dc7-39462498" |
| 29 | Accept-Ranges: bytes |
| 30 | Content-Length: 6 |
| 31 | Connection: close |
| 32 | Content-Type: text/html |
| 33 | Funny-head: yesyes |
| 34 | |
| 35 | -foo- |
| 36 | </data> |
| 37 | </reply> |
| 38 | |
| 39 | # |
| 40 | # Client-side |
| 41 | <client> |
| 42 | <server> |
| 43 | http |
| 44 | </server> |
| 45 | |
| 46 | # requires debug so that it can use the DoH server without https |
| 47 | # requires IPv6 so that we can assume and compare both DoH requests |
| 48 | |
| 49 | <features> |
| 50 | debug |
| 51 | DoH |
| 52 | ipv6 |
| 53 | </features> |
| 54 | <name> |
| 55 | HTTP GET using DoH |
| 56 | </name> |
| 57 | <command> |
| 58 | http://foo.example.com:%HTTPPORT/%TESTNUMBER --doh-url http://%HOSTIP:%HTTPPORT/%TESTNUMBER0001 |
| 59 | </command> |
| 60 | </client> |
| 61 | |
| 62 | # |
| 63 | # Verify data after the test has been "shot" |
| 64 | <verify> |
| 65 | |
| 66 | # To make the test ignore the order of the two outgoing DoH requests, strip |
| 67 | # the family byte |
| 68 | |
| 69 | <strippart> |
| 70 | s/com\x00\x00(\x1c|\x01)/com-00-00!/g; |
| 71 | </strippart> |
| 72 | <protocol> |
| 73 | POST /%TESTNUMBER0001 HTTP/1.1
|
| 74 | Host: %HOSTIP:%HTTPPORT
|
| 75 | Accept: */*
|
| 76 | Content-Type: application/dns-message
|
| 77 | Content-Length: 33
|
| 78 |
|
| 79 | %hex[%00%00%01%00%00%01%00%00%00%00%00%00%03foo%07example%03com-00-00!%00%01]hex%POST /%TESTNUMBER0001 HTTP/1.1
|
| 80 | Host: %HOSTIP:%HTTPPORT
|
| 81 | Accept: */*
|
| 82 | Content-Type: application/dns-message
|
| 83 | Content-Length: 33
|
| 84 |
|
| 85 | %hex[%00%00%01%00%00%01%00%00%00%00%00%00%03foo%07example%03com-00-00!%00%01]hex%GET /%TESTNUMBER HTTP/1.1
|
| 86 | Host: foo.example.com:%HTTPPORT
|
| 87 | User-Agent: curl/%VERSION
|
| 88 | Accept: */*
|
| 89 |
|
| 90 | </protocol> |
| 91 | </verify> |
| 92 | </testcase> |