Interface DtlsClientConnection.Builder<B extends Builder<B>>
-
Method Summary
Modifier and TypeMethodDescriptiondefault B
setServerIdentity
(SocketConnectable serverIdentity) AGSocketConnectable
describing the identity of the server that is expected on the other end of the connection.default B
setValidationFlags
(Set<TlsCertificateFlags> validationFlags) Deprecated.default B
setValidationFlags
(TlsCertificateFlags... validationFlags) Deprecated.Methods inherited from interface io.github.jwharm.javagi.gobject.BuilderInterface
addBuilderProperty, connect, connect, getArena
-
Method Details
-
setServerIdentity
AGSocketConnectable
describing the identity of the server that is expected on the other end of the connection.If the
TlsCertificateFlags.BAD_IDENTITY
flag is set inGDtlsClientConnection
:validation-flags, this object will be used to determine the expected identify of the remote end of the connection; ifGDtlsClientConnection
:server-identity is not set, or does not match the identity presented by the server, then theTlsCertificateFlags.BAD_IDENTITY
validation will fail.In addition to its use in verifying the server certificate, this is also used to give a hint to the server about what certificate we expect, which is useful for servers that serve virtual hosts.
- Parameters:
serverIdentity
- the value for theserver-identity
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setValidationFlags
Deprecated.What steps to perform when validating a certificate received from a server. Server certificates that fail to validate in any of the ways indicated here will be rejected unless the application overrides the default viaGDtlsConnection
::accept-certificate.GLib guarantees that if certificate verification fails, at least one flag will be set, but it does not guarantee that all possible flags will be set. Accordingly, you may not safely decide to ignore any particular type of error. For example, it would be incorrect to mask
TlsCertificateFlags.EXPIRED
if you want to allow expired certificates, because this could potentially be the only error flag set even if other problems exist with the certificate. Therefore, there is no safe way to use this property. This is not a horrible problem, though, because you should not be attempting to ignore validation errors anyway. If you really must ignore TLS certificate errors, connect toGDtlsConnection
::accept-certificate.- Parameters:
validationFlags
- the value for thevalidation-flags
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-
setValidationFlags
Deprecated.What steps to perform when validating a certificate received from a server. Server certificates that fail to validate in any of the ways indicated here will be rejected unless the application overrides the default viaGDtlsConnection
::accept-certificate.GLib guarantees that if certificate verification fails, at least one flag will be set, but it does not guarantee that all possible flags will be set. Accordingly, you may not safely decide to ignore any particular type of error. For example, it would be incorrect to mask
TlsCertificateFlags.EXPIRED
if you want to allow expired certificates, because this could potentially be the only error flag set even if other problems exist with the certificate. Therefore, there is no safe way to use this property. This is not a horrible problem, though, because you should not be attempting to ignore validation errors anyway. If you really must ignore TLS certificate errors, connect toGDtlsConnection
::accept-certificate.- Parameters:
validationFlags
- the value for thevalidation-flags
property- Returns:
- the
Builder
instance is returned, to allow method chaining
-