Poco::Net

class Context

Library: NetSSL_OpenSSL
Package: SSLCore
Header: Poco/Net/Context.h

Description

This class encapsulates an SSL Context.

Member Summary

Member Functions: serverContext, sslContext, verificationMode

Types

Ptr

typedef Poco::SharedPtr < Context > Ptr;

Enumerations

VerificationMode

VERIFY_NONE = 0x00

VERIFY_RELAXED = 0x01

VERIFY_STRICT = 0x02

VERIFY_ONCE = 0x04

Constructors

Context

Context(
    const std::string & privateKeyFile,
    const std::string & caLocation,
    bool isServerContext,
    VerificationMode verMode = VERIFY_STRICT,
    int verificationDepth = 9,
    bool loadCAFromDefaultPath = false,
    const std::string & cypherList = "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH"
);

Creates a context. privateKeyFile contains the key used for encryption, caLocation can either be a directory or a single file containing the certificates for certificate authorities. isServerContext defines if the context belongs to a server or client. verificationDepth sets the upper limit for verification chain sizes. If we encounter a chain larger than that limit, verification will fail. Cypherlist defines which protocols are allowed. Creates the Context.

Destructor

~Context

~Context();

Destroys the Context.

Member Functions

serverContext inline

bool serverContext() const;

Returns true iff the context is for a server.

sslContext inline

SSL_CTX * sslContext() const;

Returns the OpenSSL SSL Context object.

verificationMode inline

Context::VerificationMode verificationMode() const;

Returns the verification mode.