Wocky OpenSSL TLS

Wocky OpenSSL TLS — Establish TLS sessions

Functions

Properties

WockyTLSSession * session Write / Construct Only
GIOStream * base-stream Write / Construct Only
guint dh-bits Write / Construct Only
gboolean server Write / Construct Only
gchar * x509-cert Write / Construct Only
gchar * x509-key Write / Construct Only

Types and Values

Object Hierarchy

    GEnum
    ├── WockyTLSCertStatus
    ├── WockyTLSCertType
    ╰── WockyTLSVerificationLevel
    GObject
    ├── GIOStream
       ╰── WockyTLSConnection
    ╰── WockyTLSSession

Description

The WOCKY_TLS_DEBUG_LEVEL environment variable can be used to print debug output from OpenSSL. To enable it, set it to a value from 1 to 9. Higher values will print more information.

Increasing the value past certain thresholds will also trigger increased debugging output from within wocky-openssl.c as well.

Functions

wocky_tls_cert_error_quark ()

GQuark
wocky_tls_cert_error_quark (void);

WOCKY_TLS_CERT_ERROR

#define WOCKY_TLS_CERT_ERROR (wocky_tls_cert_error_quark ())

wocky_tls_error_quark ()

GQuark
wocky_tls_error_quark (void);

WOCKY_TLS_ERROR

#define WOCKY_TLS_ERROR (wocky_tls_error_quark ())

wocky_tls_session_verify_peer ()

int
wocky_tls_session_verify_peer (WockyTLSSession *session,
                               const gchar *peername,
                               GStrv extra_identities,
                               WockyTLSVerificationLevel level,
                               WockyTLSCertStatus *status);

wocky_tls_session_get_peers_certificate ()

GPtrArray *
wocky_tls_session_get_peers_certificate
                               (WockyTLSSession *session,
                                WockyTLSCertType *type);

wocky_tls_session_handshake ()

WockyTLSConnection *
wocky_tls_session_handshake (WockyTLSSession *session,
                             GCancellable *cancellable,
                             GError **error);

wocky_tls_session_handshake_async ()

void
wocky_tls_session_handshake_async (WockyTLSSession *session,
                                   gint io_priority,
                                   GCancellable *cancellable,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

wocky_tls_session_handshake_finish ()

WockyTLSConnection *
wocky_tls_session_handshake_finish (WockyTLSSession *session,
                                    GAsyncResult *result,
                                    GError **error);

wocky_tls_session_add_ca ()

void
wocky_tls_session_add_ca (WockyTLSSession *session,
                          const gchar *path);

wocky_tls_session_add_crl ()

void
wocky_tls_session_add_crl (WockyTLSSession *session,
                           const gchar *path);

wocky_tls_session_new ()

WockyTLSSession *
wocky_tls_session_new (GIOStream *stream);

wocky_tls_session_server_new ()

WockyTLSSession *
wocky_tls_session_server_new (GIOStream *stream,
                              guint dhbits,
                              const gchar *key,
                              const gchar *cert);

Create a new TLS server session

Parameters

stream

a GIOStream on which we expect to receive the client TLS handshake

 

dhbits

size of the DH parameters

 

key

the path to the X509 PEM key file

 

cert

the path to the X509 PEM certificate

 

Returns

a WockyTLSSession object

Types and Values

enum WockyTLSVerificationLevel

Members

WOCKY_TLS_VERIFY_STRICT

   

WOCKY_TLS_VERIFY_NORMAL

   

WOCKY_TLS_VERIFY_LENIENT

   

enum WockyTLSCertStatus

Members

WOCKY_TLS_CERT_OK

   

WOCKY_TLS_CERT_INVALID

   

WOCKY_TLS_CERT_NAME_MISMATCH

   

WOCKY_TLS_CERT_REVOKED

   

WOCKY_TLS_CERT_SIGNER_UNKNOWN

   

WOCKY_TLS_CERT_SIGNER_UNAUTHORISED

   

WOCKY_TLS_CERT_INSECURE

   

WOCKY_TLS_CERT_NOT_ACTIVE

   

WOCKY_TLS_CERT_EXPIRED

   

WOCKY_TLS_CERT_NO_CERTIFICATE

   

WOCKY_TLS_CERT_MAYBE_DOS

   

WOCKY_TLS_CERT_INTERNAL_ERROR

   

WOCKY_TLS_CERT_UNKNOWN_ERROR

   

enum WockyTLSCertType

Members

WOCKY_TLS_CERT_TYPE_NONE

   

WOCKY_TLS_CERT_TYPE_X509

   

WOCKY_TLS_CERT_TYPE_OPENPGP

   

Property Details

The “session” property

  “session”                  WockyTLSSession *

the TLS session object for this connection.

Flags: Write / Construct Only


The “base-stream” property

  “base-stream”              GIOStream *

the stream that TLS communicates over.

Flags: Write / Construct Only


The “dh-bits” property

  “dh-bits”                  guint

Diffie-Hellmann bits: 768, 1024, 2048, 3072 0r 4096.

Flags: Write / Construct Only

Allowed values: [768,4096]

Default value: 1024


The “server” property

  “server”                   gboolean

whether this is a server.

Flags: Write / Construct Only

Default value: FALSE


The “x509-cert” property

  “x509-cert”                gchar *

x509 PEM certificate file.

Flags: Write / Construct Only

Default value: NULL


The “x509-key” property

  “x509-key”                 gchar *

x509 PEM key file.

Flags: Write / Construct Only

Default value: NULL