TsgcHTTP2ClientProprietà › TLSOptions

TLSOptions Property

Configura certificati, versione TLS, ALPN, IOHandler e altri dettagli della connessione sicura utilizzati per HTTP/2 su TLS.

Sintassi

property TLSOptions: TsgcTCPTLS_Options read FTLSOptions write SetTLSOptions;

Valore predefinito

Note

Utilizzato quando TLS è True. Le sotto-proprietà includono RootCertFile, CertFile, KeyFile, Password, VerifyCertificate, VerifyDepth, Version (da tlsUndefined fino a tls1_3), ALPNProtocols e IOHandler (iohOpenSSL, iohSChannel, iohAndroidTLS o iohAppleTLS). Su Android, iohAndroidTLS utilizza il TLS nativo della piattaforma (javax.net.ssl.SSLEngine) e su iOS e macOS, iohAppleTLS utilizza il TLS nativo di Apple, quindi non è necessario distribuire alcuna libreria OpenSSL; il TLS nativo della piattaforma richiede l'edizione Enterprise. HTTP/2 richiede ALPN per annunciare il protocollo h2 durante l'handshake TLS; il componente popola automaticamente l'elenco ALPN con h2, ma ALPNProtocols può essere esteso se il server prevede identificatori aggiuntivi. Le impostazioni specifiche di OpenSSL si trovano in OpenSSL_Options e quelle specifiche di SChannel in SChannel_Options. Per HTTP/2 si consiglia TLS 1.2 o superiore.

Esempio


oHTTP2 := TsgcHTTP2Client.Create(nil);
oHTTP2.Host := 'http2.akamai.com';
oHTTP2.Port := 443;
oHTTP2.TLS := True;
oHTTP2.TLSOptions.Version := tls1_2;
oHTTP2.TLSOptions.VerifyCertificate := True;
oHTTP2.TLSOptions.RootCertFile := 'cacert.pem';

Torna alle Proprietà