TLSOptions
TLS configuration for clients and servers.
TLSOptions.swift:20class 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 client(trustedChain:commonNameOverride:)
, clientUnsafe(trustedChain:)
, or server(key:certificate:)
should be used instead.
Superclasses
class RefCounted
Base class for reference-counted objects.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
static func client(trustedChain: X509Certificate?, commonNameOverride: String
) -> TLSOptions? Creates a TLS client configuration which validates certificates and their common names (fully qualified domain names).
static func clientUnsafe(trustedChain: X509Certificate?
) -> TLSOptions? 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.static func server(key: CryptoKey?, certificate: X509Certificate?
) -> TLSOptions? Creates a TLS server configuration using the provided
key
andcertificate
.class var godotClassName: StringName
Instance members
func getCommonNameOverride(
) -> String Returns the common name (domain name) override specified when creating with
client(trustedChain:commonNameOverride:)
.func getOwnCertificate(
) -> X509Certificate? Returns the
X509Certificate
specified when creating withserver(key:certificate:)
.func getPrivateKey(
) -> CryptoKey? Returns the
CryptoKey
specified when creating withserver(key:certificate:)
.func getTrustedCaChain(
) -> X509Certificate? Returns the CA
X509Certificate
chain specified when creating withclient(trustedChain:commonNameOverride:)
orclientUnsafe(trustedChain:)
.func isServer(
) -> Bool Returns
true
if created withserver(key:certificate:)
,false
otherwise.func isUnsafeClient(
) -> Bool Returns
true
if created withclientUnsafe(trustedChain:)
,false
otherwise.