Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // www.google.com resolves to 142.250.65.206
- // but not to 8.8.8.8
- var httpClient = new HttpClient();
- var requestUri = new Uri("https://8.8.8.8/");
- var request = new HttpRequestMessage(HttpMethod.Get, requestUri);
- request.Headers.TryAddWithoutValidation("host", "www.google.com");
- var response = await httpClient.SendAsync(request);
- // This produces WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
Advertisement
Add Comment
Please, Sign In to add comment