C AMQP Protocol Engine API  0.7
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ssl.h File Reference
#include <proton/import_export.h>
#include <sys/types.h>
#include <proton/type_compat.h>
#include <proton/engine.h>
Include dependency graph for ssl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


typedef struct pn_ssl_domain_t pn_ssl_domain_t
typedef struct pn_ssl_t pn_ssl_t


enum  pn_ssl_mode_t { PN_SSL_MODE_CLIENT =1, PN_SSL_MODE_SERVER }


PN_EXTERN pn_ssl_domain_tpn_ssl_domain (pn_ssl_mode_t mode)
PN_EXTERN void pn_ssl_domain_free (pn_ssl_domain_t *domain)
PN_EXTERN int pn_ssl_domain_set_credentials (pn_ssl_domain_t *domain, const char *certificate_file, const char *private_key_file, const char *password)
PN_EXTERN int pn_ssl_domain_set_trusted_ca_db (pn_ssl_domain_t *domain, const char *certificate_db)
PN_EXTERN int pn_ssl_domain_set_peer_authentication (pn_ssl_domain_t *domain, const pn_ssl_verify_mode_t mode, const char *trusted_CAs)
PN_EXTERN int pn_ssl_domain_allow_unsecured_client (pn_ssl_domain_t *domain)
PN_EXTERN pn_ssl_tpn_ssl (pn_transport_t *transport)
PN_EXTERN int pn_ssl_init (pn_ssl_t *ssl, pn_ssl_domain_t *domain, const char *session_id)
PN_EXTERN bool pn_ssl_get_cipher_name (pn_ssl_t *ssl, char *buffer, size_t size)
PN_EXTERN bool pn_ssl_get_protocol_name (pn_ssl_t *ssl, char *buffer, size_t size)
PN_EXTERN pn_ssl_resume_status_t pn_ssl_resume_status (pn_ssl_t *ssl)
PN_EXTERN int pn_ssl_set_peer_hostname (pn_ssl_t *ssl, const char *hostname)
PN_EXTERN int pn_ssl_get_peer_hostname (pn_ssl_t *ssl, char *hostname, size_t *bufsize)

Detailed Description

API for using SSL with the Transport Layer.

A Transport may be configured to use SSL for encryption and/or authentication. A Transport can be configured as either an "SSL client" or an "SSL server". An SSL client is the party that proactively establishes a connection to an SSL server. An SSL server is the party that accepts a connection request from a remote SSL client.

This SSL implementation defines the following objects:

  • A top-level object that stores the configuration used by one or more SSL sessions (pn_ssl_domain_t).
  • A per-connection SSL session object that performs the encryption/authentication associated with the transport (pn_ssl_t).
  • The encryption parameters negotiated for the SSL session (pn_ssl_state_t).

A pn_ssl_domain_t object must be created and configured before an SSL session can be established. The pn_ssl_domain_t is used to construct an SSL session (pn_ssl_t). The session "adopts" its configuration from the pn_ssl_domain_t that was used to create it. For example, pn_ssl_domain_t can be configured as either a "client" or a "server". SSL sessions constructed from this domain will perform the corresponding role (either client or server).

If either an SSL server or client needs to identify itself with the remote node, it must have its SSL certificate configured (see pn_ssl_domain_set_credentials()).

If either an SSL server or client needs to verify the identity of the remote node, it must have its database of trusted CAs configured (see pn_ssl_domain_set_trusted_ca_db()).

An SSL server connection may allow the remote client to connect without SSL (eg. "in the clear"), see pn_ssl_domain_allow_unsecured_client().

The level of verification required of the remote may be configured (see pn_ssl_domain_set_peer_authentication)

Support for SSL Client Session resume is provided (see pn_ssl_init, pn_ssl_resume_status).