TsgcAIChat › Properties › TLSOptions

TLSOptions Property

TLS settings used by the HTTPS requests sent to the AI provider, including the OpenSSL API version.

Syntax

property TLSOptions: TsgcHTTPTLS_Options read FTLSOptions write SetTLSOptions;

Default Value

Version = tls1_2, OpenSSL_Options.APIVersion = oslAPI_1_0

Remarks

The component creates the provider client internally, so these options are copied to that client before every Chat, ChatStream or ChatJSON request, whatever the selected Provider. The defaults are the same as the HTTP API clients, so an application that does not touch this property behaves exactly as before.

The most common setting is OpenSSL_Options.APIVersion. It defaults to oslAPI_1_0, which loads libeay32.dll and ssleay32.dll. When the application ships only the OpenSSL 3 libraries (libcrypto-3.dll and libssl-3.dll, or the -x64 variants), set it to oslAPI_3_0, otherwise the request fails with Failed to load libeay32.dll.

The other members work as in the rest of the HTTP components: Version (TLS protocol version), IOHandler (OpenSSL or SChannel), VerifyCertificate, RootCertFile, CertFile, KeyFile, Password, ALPNProtocols, OpenSSL_Options, SChannel_Options and NativeTLS_Options.

Example

oChat.Provider := aicpAnthropic;
// only libcrypto-3.dll and libssl-3.dll are deployed with the application
oChat.TLSOptions.OpenSSL_Options.APIVersion := oslAPI_3_0;
WriteLn(oChat.Chat('Reply with the single word: pong'));

Back to Properties