Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members

# ACE_SSL_Context Class Reference

A wrapper for the OpenSSL SSL_CTX related functions. More...

`#include <SSL_Context.h>`

List of all members.

## Public Types
enum | { INVALID_METHOD = -1, SSLv2_client = 1, SSLv2_server, SSLv2, SSLv3_client, SSLv3_server, SSLv3, SSLv23_client, SSLv23_server, SSLv23, TLSv1_client, TLSv1_server, TLSv1 }
## Public Methods
| ACE_SSL_Context (void)
| Constructor.
| ~ACE_SSL_Context (void)
| Destructor.
int | set_mode (int mode = ACE_SSL_Context::SSLv23)
int | get_mode (void) const
SSL_CTX* | context (void)
| Get the SSL context.
int | private_key_type (void) const
| Get the file name and file format used for the private key.
const char* | private_key_file_name (void) const
int | private_key (const char *file_name, int type = SSL_FILETYPE_PEM)
| Set the private key file.
int | verify_private_key (void)
| Verify if the private key is valid.
int | certificate_type (void) const
| Get the file name and file format used for the certificate file.
const char* | certificate_file_name (void) const
int | certificate (const char *file_name, int type = SSL_FILETYPE_PEM)
| Set the certificate file.
void | default_verify_mode (int mode)
int | default_verify_mode (void) const
OpenSSL Random Number Generator Seed Related Methods
These are methods that can be used to seed OpenSSL's pseudo-random number generator. These methods can be called more than once.
int | random_seed (const char * seed)
| Seed the underlying random number generator. This value should have at least 128 bits of entropy.
int | egd_file (const char * socket_file)
| Set the Entropy Gathering Daemon (EGD) UNIX domain socket file to read random seed values from.
int | seed_file (const char * seed_file, long bytes = -1)
## Static Public Methods
ACE_SSL_Context* | instance (void)
| The Singleton context, the SSL components use the singleton if nothing else is available.
void | report_error (unsigned long error_code)
| Print SSL error corresponding to the given error code.
void | report_error (void)
| Print the last SSL error for the current thread.
## Private Methods
void | check_context (void)
| Verify if the context has been initialized or not.
void | ssl_library_init ()
| More to document. More...
void | ssl_library_fini ()
## Friends
void | ACE_SSL_locking_callback (int, int, const char *, int)
| Mutex locking/unlocking callback for OpenSSL multithread support.

## Detailed Description

A wrapper for the OpenSSL SSL_CTX related functions.

This class provides a wrapper for the SSL_CTX data structure. Since most applications have a single SSL_CTX structure, this class can be used as a singleton.

## Member Enumeration Documentation

anonymous enum

  | Enumeration values:
  INVALID_METHOD |
  SSLv2_client |
  SSLv2_server |
  SSLv2 |
  SSLv3_client |
  SSLv3_server |
  SSLv3 |
  SSLv23_client |
  SSLv23_server |
  SSLv23 |
  TLSv1_client |
  TLSv1_server |
  TLSv1 |

## Constructor & Destructor Documentation

ACE_SSL_Context::ACE_SSL_Context ( | void )

| Constructor.

ACE_SSL_Context::~ACE_SSL_Context ( | void )

| Destructor.

## Member Function Documentation

int ACE_SSL_Context::certificate ( | const char * file_name,
| int type = SSL_FILETYPE_PEM )

| Set the certificate file.

ACE_INLINE const char * ACE_SSL_Context::certificate_file_name ( | void ) const

ACE_INLINE int ACE_SSL_Context::certificate_type ( | void ) const

| Get the file name and file format used for the certificate file.

ACE_INLINE void ACE_SSL_Context::check_context ( | void )`[private]`

| Verify if the context has been initialized or not.

ACE_INLINE SSL_CTX * ACE_SSL_Context::context ( | void )

| Get the SSL context.

ACE_INLINE int ACE_SSL_Context::default_verify_mode ( | void ) const

ACE_INLINE void ACE_SSL_Context::default_verify_mode ( | int mode )

| Set and query the default verify mode for this context, it is inherited by all the ACE_SSL objects created using the context. It can be overriden on a per-ACE_SSL object.

int ACE_SSL_Context::egd_file ( | const char * socket_file )

| Set the Entropy Gathering Daemon (EGD) UNIX domain socket file to read random seed values from.

int ACE_SSL_Context::get_mode ( | void ) const

ACE_INLINE ACE_SSL_Context * ACE_SSL_Context::instance ( | void )`[static]`

| The Singleton context, the SSL components use the singleton if nothing else is available.

int ACE_SSL_Context::private_key ( | const char * file_name,
| int type = SSL_FILETYPE_PEM )

| Set the private key file.

ACE_INLINE const char * ACE_SSL_Context::private_key_file_name ( | void ) const

ACE_INLINE int ACE_SSL_Context::private_key_type ( | void ) const

| Get the file name and file format used for the private key.

int ACE_SSL_Context::random_seed ( | const char * seed )

| Seed the underlying random number generator. This value should have at least 128 bits of entropy.

void ACE_SSL_Context::report_error ( | void )`[static]`

| Print the last SSL error for the current thread.

void ACE_SSL_Context::report_error ( | unsigned long error_code )`[static]`

| Print SSL error corresponding to the given error code.

int ACE_SSL_Context::seed_file ( | const char * seed_file,
| long bytes = -1 )

| Set the file that contains the random seed value state, and the amount of bytes to read. "-1" bytes causes the entire file to be read.

int ACE_SSL_Context::set_mode ( | int mode = ACE_SSL_Context::SSLv23 )

| Set the CTX mode. The mode can be set only once, afterwards the function has no effect and returns -1. Once the mode is set the underlying SSL_CTX is initialized and the class can be used. If the mode is not set, then the class automatically initializes itself to the default mode.

void ACE_SSL_Context::ssl_library_fini ( | void )`[private]`

void ACE_SSL_Context::ssl_library_init ( | void )`[private]`

| More to document. @

int ACE_SSL_Context::verify_private_key ( | void )

| Verify if the private key is valid.

## Friends And Related Function Documentation

void ACE_SSL_locking_callback ( | int mode,
| int type,
| const char * file,
| int line )`[friend]`

| Mutex locking/unlocking callback for OpenSSL multithread support.

The documentation for this class was generated from the following files:

- SSL_Context.h
- SSL_Context.cpp
- SSL_Context.i