30#ifndef PT_SSL_CONTEXT_H
31#define PT_SSL_CONTEXT_H
33#include <Pt/Ssl/Api.h>
34#include <Pt/NonCopyable.h>
45static struct PT_SSL_API SSLInit
176 const ContextImpl* impl()
const;
NonCopyable()
Default constructor.
Definition NonCopyable.h:63
X509 certificate.
Definition Certificate.h:56
void setVerifyDepth(int n)
Limits how many certificates are checked in the peer chain.
void addCACertificate(const Certificate &trustedCert)
Adds trustedCert to the trusted CA certificates.
void setIdentity(const Certificate &cert)
Sets the certificate presented to the peer.
void addCertificate(const Certificate &cert)
Adds cert to the chain presented with the identity.
Context()
Creates a context for the highest available TLS protocol.
Context(Protocol protocol)
Creates a context for protocol.
void assign(const Context &ctx)
Copies protocol, verify settings and certificates from ctx.
void setVerifyMode(VerifyMode mode)
Sets the verification mode.
Protocol protocol() const
Returns the protocol.
void setProtocol(Protocol protocol)
Sets the protocol.
VerifyMode verifyMode() const
Returns the verification mode.
Protocol
SSL/TLS protocol version.
Definition Context.h:66
VerifyMode
How the peer certificate is verified.
Definition Context.h:81
@ TLSv1
TLS version 1.0.
Definition Context.h:71
@ SSLv3or2
Highest available protocol version.
Definition Context.h:68
@ SSLv3
SSL version 3.
Definition Context.h:69
@ TLSv1_2
TLS version 1.2.
Definition Context.h:73
@ TLS
Highest available TLS protocol version.
Definition Context.h:70
@ SSLv2
SSL version 2.
Definition Context.h:67
@ TLSv1_1
TLS version 1.1.
Definition Context.h:72
@ TryVerify
Verify a certificate when the peer presents one.
Definition Context.h:83
@ AlwaysVerify
Require a peer certificate.
Definition Context.h:84
@ NoVerify
Do not verify the peer.
Definition Context.h:82
OpenMode
Open mode for an SSL stream.
Definition Context.h:56
@ Accept
Server handshake.
Definition Context.h:58
@ Connect
Client handshake.
Definition Context.h:57
SSL/TLS streams, certificates and contexts.
Definition Client.h:50
Core module.
Definition Allocator.h:33