Conversation
shargon
left a comment
There was a problem hiding this comment.
I think that it's better to define the dns server, and make a dns query, instead of http query
We need DNS over HTTPS. |
Then it's DoH no Dns, we should rename the oracle protocol |
| CertificatePublicKey key = new() | ||
| { | ||
| Algorithm = cert.PublicKey.Oid?.FriendlyName ?? cert.PublicKey.Oid?.Value, | ||
| Encoded = Convert.ToBase64String(cert.GetPublicKey()) |
There was a problem hiding this comment.
I think that it's better to construct this object inside the try/catch clause, it's possible to throw CryptographicException during cert.GetPublicKey()
DoH is very commom see https://www.rfc-editor.org/rfc/rfc8484.html Can we follow rfc8484? |
Co-authored-by: Will <201105916+Wi1l-B0t@users.noreply.github.com>
Co-authored-by: Will <201105916+Wi1l-B0t@users.noreply.github.com>
- Replace application/dns-json with standard application/dns-message - Implement DNS wire format (RFC 1035) for query/response encoding - Use HTTP POST method per RFC 8484 specification - Add DNS name compression pointer support - Support user-specified authority in URI (dns://resolver/domain) - Fix CryptographicException handling in BuildPublicKey - Move Accept header to constructor - Add comprehensive unit tests for wire format handling - Add integration tests for Cloudflare, Google, and Quad9 DoH endpoints - Update documentation with RFC 8484 compliance details
|
|
@Jim8y, I found some issues during the way when trying to test it. But I needed to fix some parsing errors due to docker versions on my tools. Meanwhile, can you provide here examples of what to expect from the oracle calls in this PR, @Jim8y ? I see that we could now do posting, is that correct? |
| "Timeout": 15000 | ||
| }, | ||
| "Dns": { | ||
| "EndPoint": "https://cloudflare-dns.com/dns-query", | ||
| "TimeoutMilliseconds": 5000 |
There was a problem hiding this comment.
L15 and L19, one is Timeout and the other is TimeoutMilliseconds. It's best to keep them consistent.
There was a problem hiding this comment.
Could use backups like google https://dns.google/resolve?name=google.com&type=A
| if (response.Content.Headers.ContentLength.HasValue && response.Content.Headers.ContentLength > OracleResponse.MaxResultSize) | ||
| throw new ResponseTooLargeException(); | ||
|
|
||
| using Stream stream = await response.Content.ReadAsStreamAsync(cancellation); |
There was a problem hiding this comment.
IO Pipelines would work better here, better buffering and memory management.
https://learn.microsoft.com/en-us/dotnet/standard/io/pipelines
|
UT Failed. |
|
@Jim8y any progress with this? |
Co-authored-by: Christopher Schuchardt <8141309+cschuchardt88@users.noreply.github.com>
Summary
Testing