30 #ifndef PT_SSL_CONTEXT_H
31 #define PT_SSL_CONTEXT_H
33 #include <Pt/Ssl/Api.h>
34 #include <Pt/NonCopyable.h>
45 static struct PT_SSL_API SSLInit
135 const ContextImpl* impl()
const;
145 #endif // PT_SSL_CONTEXT_H
@ TLSv1
TLS version 1.0.
Definition: Context.h:65
Core module.
Definition: Allocator.h:33
void assign(const Context &ctx)
Assigns the certificates, verify mode and protocol.
@ TLSv1_2
TLS version 1.2.
Definition: Context.h:67
Protocol protocol() const
Returns the current protocol.
@ NoVerify
No verification.
Definition: Context.h:73
@ SSLv3or2
highest possible protocol version
Definition: Context.h:62
OpenMode
Open mode for ssl I/O.
Definition: Context.h:53
@ TryVerify
Verify if certificate is presented.
Definition: Context.h:74
@ Accept
Accept client.
Definition: Context.h:55
@ SSLv3
SSL version 3.
Definition: Context.h:63
Protocol
Communication protocol.
Definition: Context.h:60
void setProtocol(Protocol protocol)
Sets the current protocol.
@ TLSv1_1
TLS version 1.1.
Definition: Context.h:66
void setVerifyMode(VerifyMode mode)
Sets the current validation mode.
@ AlwaysVerify
Require tp present certificate.
Definition: Context.h:75
VerifyMode
Verification mode.
Definition: Context.h:72
void setIdentity(const Certificate &cert)
Set the main certificate of this context.
@ SSLv2
SSL version 2.
Definition: Context.h:61
void addCACertificate(const Certificate &trustedCert)
Add a certificate to the trusted CA certificates.
@ TLS
highest possible TLS protocol version
Definition: Context.h:64
X509 certificate.
Definition: Certificate.h:45
void addCertificate(const Certificate &cert)
Builds certificate chain.
void setVerifyDepth(int n)
Limits the number of certificates checked in the peer's certificate chain.
VerifyMode verifyMode() const
Returns the current verify mode.
Context(Protocol protocol)
Construct with specific protocol.
Protects derived classes from being copied.
Definition: NonCopyable.h:54
Context()
Construct with defaults.
@ Connect
Connect to server.
Definition: Context.h:54
Context for SSL connections.
Definition: Context.h:80