Class TlsOptions
- Namespace
 - Godot
 
- Assembly
 - GodotSharp.dll
 
TLSOptions abstracts the configuration options for the StreamPeerTls and PacketPeerDtls classes.
Objects of this class cannot be instantiated directly, and one of the static methods Client(X509Certificate, string), ClientUnsafe(X509Certificate), or Server(CryptoKey, X509Certificate) should be used instead.
[GodotClassName("TLSOptions")]
public class TlsOptions : RefCounted, IDisposable
  - Inheritance
 - 
      
      
      
      TlsOptions
 
- Implements
 
- Inherited Members
 
Methods
Client(X509Certificate, string)
Creates a TLS client configuration which validates certificates and their common names (fully qualified domain names).
You can specify a custom trustedChain of certification authorities (the default CA list will be used if null), and optionally provide a commonNameOverride if you expect the certificate to have a common name other than the server FQDN.
Note: On the Web platform, TLS verification is always enforced against the CA list of the web browser. This is considered a security feature.
public static TlsOptions Client(X509Certificate trustedChain = null, string commonNameOverride = "")
  Parameters
trustedChainX509CertificatecommonNameOverridestring
Returns
ClientUnsafe(X509Certificate)
Creates an unsafe TLS client configuration where certificate validation is optional. You can optionally provide a valid trustedChain, but the common name of the certificates will never be checked. Using this configuration for purposes other than testing is not recommended.
Note: On the Web platform, TLS verification is always enforced against the CA list of the web browser. This is considered a security feature.
public static TlsOptions ClientUnsafe(X509Certificate trustedChain = null)
  Parameters
trustedChainX509Certificate
Returns
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
  Parameters
methodgodot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
  Parameters
signalgodot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
  Parameters
methodgodot_string_nameName of the method to invoke.
argsNativeVariantPtrArgsArguments to use with the invoked method.
retgodot_variantValue returned by the invoked method.
Returns
Server(CryptoKey, X509Certificate)
Creates a TLS server configuration using the provided key and certificate.
  Note: The certificate should include the full certificate chain up to the signing CA (certificates file can be concatenated using a general purpose text editor).
public static TlsOptions Server(CryptoKey key, X509Certificate certificate)
  Parameters
keyCryptoKeycertificateX509Certificate