Documentation
¶
Overview ¶
Package TLSOptions provides methods for working with TLSOptions object instances.
Index ¶
- type Advanced
- type Any
- type Extension
- type ID
- type Instance
- func Client(trusted_chain X509Certificate.Instance, common_name_override string) Instance
- func ClientOptions(trusted_chain X509Certificate.Instance, common_name_override string) Instance
- func ClientUnsafe(trusted_chain X509Certificate.Instance) Instance
- func ClientUnsafeOptions(trusted_chain X509Certificate.Instance) Instance
- func New() Instance
- func Server(key CryptoKey.Instance, certificate X509Certificate.Instance) Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsTLSOptions() Instance
- func (self Instance) GetCommonNameOverride() string
- func (self Instance) GetOwnCertificate() X509Certificate.Instance
- func (self Instance) GetPrivateKey() CryptoKey.Instance
- func (self Instance) GetTrustedCaChain() X509Certificate.Instance
- func (self Instance) ID() ID
- func (self Instance) IsServer() bool
- func (self Instance) IsUnsafeClient() bool
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) Virtual(name string) reflect.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsTLSOptions ¶
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.TLSOptions
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 [method client], [method client_unsafe], or [method server] should be used instead. [codeblocks] [gdscript] # Create a TLS client configuration which uses our custom trusted CA chain. var client_trusted_cas = load("res://my_trusted_cas.crt") var client_tls_options = TLSOptions.client(client_trusted_cas)
# Create a TLS server configuration. var server_certs = load("res://my_server_cas.crt") var server_key = load("res://my_server_key.key") var server_tls_options = TLSOptions.server(server_key, server_certs) [/gdscript] [/codeblocks]
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func Client ¶
func Client(trusted_chain X509Certificate.Instance, common_name_override string) Instance
Creates a TLS client configuration which validates certificates and their common names (fully qualified domain names). You can specify a custom [param trusted_chain] of certification authorities (the default CA list will be used if [code]null[/code]), and optionally provide a [param common_name_override] if you expect the certificate to have a common name other than the server FQDN. [b]Note:[/b] On the Web platform, TLS verification is always enforced against the CA list of the web browser. This is considered a security feature.
func ClientOptions ¶
func ClientOptions(trusted_chain X509Certificate.Instance, common_name_override string) Instance
Creates a TLS client configuration which validates certificates and their common names (fully qualified domain names). You can specify a custom [param trusted_chain] of certification authorities (the default CA list will be used if [code]null[/code]), and optionally provide a [param common_name_override] if you expect the certificate to have a common name other than the server FQDN. [b]Note:[/b] On the Web platform, TLS verification is always enforced against the CA list of the web browser. This is considered a security feature.
func ClientUnsafe ¶
func ClientUnsafe(trusted_chain X509Certificate.Instance) Instance
Creates an [b]unsafe[/b] TLS client configuration where certificate validation is optional. You can optionally provide a valid [param trusted_chain], but the common name of the certificates will never be checked. Using this configuration for purposes other than testing [b]is not recommended[/b]. [b]Note:[/b] On the Web platform, TLS verification is always enforced against the CA list of the web browser. This is considered a security feature.
func ClientUnsafeOptions ¶
func ClientUnsafeOptions(trusted_chain X509Certificate.Instance) Instance
Creates an [b]unsafe[/b] TLS client configuration where certificate validation is optional. You can optionally provide a valid [param trusted_chain], but the common name of the certificates will never be checked. Using this configuration for purposes other than testing [b]is not recommended[/b]. [b]Note:[/b] On the Web platform, TLS verification is always enforced against the CA list of the web browser. This is considered a security feature.
func Server ¶
func Server(key CryptoKey.Instance, certificate X509Certificate.Instance) Instance
Creates a TLS server configuration using the provided [param key] and [param certificate]. [b]Note:[/b] The [param certificate] should include the full certificate chain up to the signing CA (certificates file can be concatenated using a general purpose text editor).
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsTLSOptions ¶
func (Instance) GetCommonNameOverride ¶
Returns the common name (domain name) override specified when creating with [method TLSOptions.client].
func (Instance) GetOwnCertificate ¶
func (self Instance) GetOwnCertificate() X509Certificate.Instance
Returns the [X509Certificate] specified when creating with [method TLSOptions.server].
func (Instance) GetPrivateKey ¶
Returns the [CryptoKey] specified when creating with [method TLSOptions.server].
func (Instance) GetTrustedCaChain ¶
func (self Instance) GetTrustedCaChain() X509Certificate.Instance
Returns the CA [X509Certificate] chain specified when creating with [method TLSOptions.client] or [method TLSOptions.client_unsafe].
func (Instance) IsServer ¶
Returns [code]true[/code] if created with [method TLSOptions.server], [code]false[/code] otherwise.
func (Instance) IsUnsafeClient ¶
Returns [code]true[/code] if created with [method TLSOptions.client_unsafe], [code]false[/code] otherwise.