Interface DtlsClientConnection

All Superinterfaces:
DatagramBased, DtlsConnection, Proxy
All Known Implementing Classes:
DtlsClientConnection.DtlsClientConnection$Impl

@Generated("org.javagi.JavaGI") public interface DtlsClientConnection extends Proxy, DatagramBased, DtlsConnection
GDtlsClientConnection is the client-side subclass of DtlsConnection, representing a client-side DTLS connection.
Since:
2.48
  • Method Details

    • getType

      static @Nullable Type getType()
      Get the GType of the DtlsClientConnection class.
      Returns:
      the GType
    • new_

      static DtlsClientConnection new_(DatagramBased baseSocket, @Nullable SocketConnectable serverIdentity) throws GErrorException
      Creates a new GDtlsClientConnection wrapping baseSocket which is assumed to communicate with the server identified by serverIdentity.
      Parameters:
      baseSocket - the GDatagramBased to wrap
      serverIdentity - the expected identity of the server
      Returns:
      the new GDtlsClientConnection, or null on error
      Throws:
      GErrorException - see GError
      Since:
      2.48
    • getAcceptedCas

      default List<MemorySegment> getAcceptedCas()

      Gets the list of distinguished names of the Certificate Authorities that the server will accept certificates from. This will be set during the TLS handshake if the server requests a certificate. Otherwise, it will be null.

      Each item in the list is a GByteArray which contains the complete subject DN of the certificate authority.

      Returns:
      the list of CA DNs. You should unref each element with g_byte_array_unref() and then the free the list with g_list_free().
      Since:
      2.48
    • getServerIdentity

      default SocketConnectable getServerIdentity()
      Gets conn's expected server identity
      Returns:
      a GSocketConnectable describing the expected server identity, or null if the expected identity is not known.
      Since:
      2.48
    • getValidationFlags

      @Deprecated default Set<TlsCertificateFlags> getValidationFlags()
      Deprecated.
      Do not attempt to ignore validation errors.

      Gets conn's validation flags

      This function does not work as originally designed and is impossible to use correctly. See GDtlsClientConnection:validation-flags for more information.

      Returns:
      the validation flags
      Since:
      2.48
    • setServerIdentity

      default void setServerIdentity(SocketConnectable identity)
      Sets conn's expected server identity, which is used both to tell servers on virtual hosts which certificate to present, and also to let this DtlsClientConnection know what name to look for in the certificate when performing TlsCertificateFlags.BAD_IDENTITY validation, if enabled.
      Parameters:
      identity - a GSocketConnectable describing the expected server identity
      Since:
      2.48
    • setValidationFlags

      @Deprecated default void setValidationFlags(Set<TlsCertificateFlags> flags)
      Deprecated.
      Do not attempt to ignore validation errors.

      Sets conn's validation flags, to override the default set of checks performed when validating a server certificate. By default, TlsCertificateFlags.VALIDATE_ALL is used.

      This function does not work as originally designed and is impossible to use correctly. See GDtlsClientConnection:validation-flags for more information.

      Parameters:
      flags - the GTlsCertificateFlags to use
      Since:
      2.48
    • setValidationFlags

      @Deprecated default void setValidationFlags(TlsCertificateFlags... flags)
      Deprecated.
      Do not attempt to ignore validation errors.

      Sets conn's validation flags, to override the default set of checks performed when validating a server certificate. By default, TlsCertificateFlags.VALIDATE_ALL is used.

      This function does not work as originally designed and is impossible to use correctly. See GDtlsClientConnection:validation-flags for more information.

      Parameters:
      flags - the GTlsCertificateFlags to use
      Since:
      2.48