PSSLContext Class Reference

Context for SSL channels. More...

`#include <pssl.h>`

## Public Types

enum | Method { SSLv23, SSLv3, TLSv1 }

## Public Member Functions

| PSSLContext (const void *sessionId=NULL, PINDEX idSize=0)
| Create a new context for SSL channels. More...
| PSSLContext (Method method, const void *sessionId=NULL, PINDEX idSize=0)
| ~PSSLContext ()
| Clean up the SSL context. More...
| operator ssl_ctx_st * () const
| Get the internal SSL context structure. More...
PBoolean | SetCAPath (const PDirectory &caPath)
| Set the path to locate CA certificates. More...
PBoolean | SetCAFile (const PFilePath &caFile)
| Set the CA certificate file. More...
PBoolean | UseCertificate (const PSSLCertificate &certificate)
| Use the certificate specified. More...
PBoolean | UsePrivateKey (const PSSLPrivateKey &key)
| Use the private key specified. More...
PBoolean | UseDiffieHellman (const PSSLDiffieHellman &dh)
| Use the Diffie-Hellman parameters specified. More...
PBoolean | SetCipherList (const PString &ciphers)
| Set the available ciphers to those listed. More...

## Protected Member Functions

void | Construct (Method method, const void *sessionId, PINDEX idSize)

## Protected Attributes

ssl_ctx_st * | context

## Detailed Description

Context for SSL channels.

This class embodies a common environment for all connections made via SSL using the PSSLChannel class. It includes such things as the version of SSL and certificates, CA's etc.

## Member Enumeration Documentation

## Method

enum PSSLContext::Method

Enumerator
SSLv23 |
SSLv3 |
TLSv1 |

## Constructor & Destructor Documentation

## PSSLContext() [1/2]

PSSLContext::PSSLContext | ( | const void * | sessionId = `NULL`,
|  | PINDEX | idSize = `0`
| ) |  |

Create a new context for SSL channels.

An optional session ID may be provided in the context. This is used to identify sessions across multiple channels in this context. The session ID is a completely arbitrary block of data. If sessionId is non NULL and idSize is zero, then sessionId is assumed to be a pointer to a C string. The default SSL method is SSLv23

Parameters

  sessionId | Pointer to session ID
  idSize | Size of session ID

## PSSLContext() [2/2]

PSSLContext::PSSLContext | ( | Method | method,
|  | const void * | sessionId = `NULL`,
|  | PINDEX | idSize = `0`
| ) |  |

Parameters

  method | SSL connection method
  sessionId | Pointer to session ID
  idSize | Size of session ID

## ~PSSLContext()

PSSLContext::~PSSLContext | ( |  | ) |

Clean up the SSL context.

## Member Function Documentation

## Construct()

void PSSLContext::Construct | ( | Method | method,
|  | const void * | sessionId,
|  | PINDEX | idSize
| ) |  |

protected

## operator ssl_ctx_st *()

PSSLContext::operator ssl_ctx_st * | ( |  | ) | const

inline

Get the internal SSL context structure.

References PSSLPrivateKey::key.

## SetCAFile()

PBoolean PSSLContext::SetCAFile | ( | const PFilePath & | caFile | ) |

Set the CA certificate file.

Parameters

  caFile | CA certificate file

## SetCAPath()

PBoolean PSSLContext::SetCAPath | ( | const PDirectory & | caPath | ) |

Set the path to locate CA certificates.

Parameters

  caPath | Directory for CA certificates

## SetCipherList()

PBoolean PSSLContext::SetCipherList | ( | const PString & | ciphers | ) |

Set the available ciphers to those listed.

Parameters

  ciphers | List of cipher names.

## UseCertificate()

PBoolean PSSLContext::UseCertificate | ( | const PSSLCertificate & | certificate | ) |

Use the certificate specified.

## UseDiffieHellman()

PBoolean PSSLContext::UseDiffieHellman | ( | const PSSLDiffieHellman & | dh | ) |

Use the Diffie-Hellman parameters specified.

## UsePrivateKey()

PBoolean PSSLContext::UsePrivateKey | ( | const PSSLPrivateKey & | key | ) |

Use the private key specified.

## Member Data Documentation

## context

ssl_ctx_st* PSSLContext::context

protected

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

- pssl.h