locked
HttpClient and HTTPS RRS feed

  • Question

  • User-1383120317 posted

    I'm not sure I understand how HttpClient is capable of sending HTTPS requests. What I mean by that is before sending an https request there should be a handshake between a client and a server. When client is a browser, I would expect it to have the handshake logic 'hardcoded' so that it knows when and what to send during each handshake step, how to store servers' certificates, public keys and so on. I have not expected HttpClient to implement that same kind of stuff. However I was very astonished when my HTTPS GET request to google succeded today.

    I'm pretty sure I'm making some false assumptions here. But my question is actually how is that possible for HttpClient to make HTTPS request? How it knows how to handshake?

    Thanks,
    Greg

    Thursday, March 22, 2012 4:36 PM

Answers

  • User720028949 posted

    HttpClient delegates to the older HttpWebRequest to handle all of the http requests. HttpWebRequest leverages the SSL (TSL) support that is within the .Net framework (take a look at System.Net) to support the TLS protocol. This type of support has been around for a long time.

    Hope that helps,

    Dave

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 22, 2012 5:18 PM

All replies

  • User720028949 posted

    HttpClient delegates to the older HttpWebRequest to handle all of the http requests. HttpWebRequest leverages the SSL (TSL) support that is within the .Net framework (take a look at System.Net) to support the TLS protocol. This type of support has been around for a long time.

    Hope that helps,

    Dave

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 22, 2012 5:18 PM
  • User-1383120317 posted

    Thanks for clarification. So HttpClient must be using SslStream for communication over https. Now it all makes sense.

    --Greg

    Thursday, March 22, 2012 5:53 PM