Recent

Author Topic: How to do SNI when using TFPHTTPClient and opensslsockets  (Read 599 times)

BrassGear

  • New Member
  • *
  • Posts: 16
  • Game Developer
    • My pascal game on itch.io
How to do SNI when using TFPHTTPClient and opensslsockets
« on: May 14, 2024, 12:41:35 pm »
Without SSL, it is enough to supply the wanted domain via the Host parameter in the header, and I gather for SSL one includes the same request via the ":authority" header. Whichever way I try, I get a 400 HTTP response from my server. I suspect this is not the correct way to do it in FreePascal.

How should I do Server Name Identification with TFPHTTPClient?

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1753
Re: How to do SNI when using TFPHTTPClient and opensslsockets
« Reply #1 on: May 14, 2024, 01:18:37 pm »
Search for "SendHostAsSNI" in the FPC sources to see how this is done.

BrassGear

  • New Member
  • *
  • Posts: 16
  • Game Developer
    • My pascal game on itch.io
Re: How to do SNI when using TFPHTTPClient and opensslsockets
« Reply #2 on: May 14, 2024, 03:08:28 pm »
It seems as though TOpenSSLSocketHandler supports using SNI, but that TFPHTTPClient does not expose the ability to have a host name different from the address.

 

TinyPortal © 2005-2018