File: Poco.Net.Context.html

package info (click to toggle)
poco-doc 1.3.6-1.1
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 10,080 kB
  • sloc: makefile: 31
file content (132 lines) | stat: -rw-r--r-- 9,565 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Class Poco::Net::Context</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="language" content="en"/>
<meta name="date" content="2009-11-24"/>
<meta name="generator" content="PocoDoc"/>
<link rel="stylesheet" href="css/styles.css" type="text/css"/>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0">
<div class="header">
<h1 class="namespace"><a href="Poco.Net.html" class="namespace">Poco::Net</a></h1>
<h1 class="symbol">class Context</h1>
</div>
<div class="body">
<p>
<b>Library:</b> NetSSL_OpenSSL<br />
<b>Package:</b> SSLCore<br />
<b>Header:</b> Poco/Net/Context.h</p>
<h2>Description</h2>
<div class="description">
<p>This class encapsulates context information for an SSL server or client, such as the certificate verification mode and the location of certificates and private key files, as well as the list of supported ciphers. </p>
</div>
<h2>Inheritance</h2>
<p><b>Direct Base Classes: </b><a href="Poco.RefCountedObject.html" title="class Poco::RefCountedObject">Poco::RefCountedObject</a></p>
<p><b>All Base Classes: </b><a href="Poco.RefCountedObject.html" title="class Poco::RefCountedObject">Poco::RefCountedObject</a></p>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.Net.Context.html#15733" title="Poco::Net::Context::enableSessionCache()">enableSessionCache</a>, <a href="Poco.Net.Context.html#15735" title="Poco::Net::Context::sessionCacheEnabled()">sessionCacheEnabled</a>, <a href="Poco.Net.Context.html#15730" title="Poco::Net::Context::sslContext()">sslContext</a>, <a href="Poco.Net.Context.html#15731" title="Poco::Net::Context::usage()">usage</a>, <a href="Poco.Net.Context.html#15732" title="Poco::Net::Context::verificationMode()">verificationMode</a></p>
<p><b>Inherited Functions: </b><a href="Poco.RefCountedObject.html#9659" title="Poco::RefCountedObject::duplicate()">duplicate</a>, <a href="Poco.RefCountedObject.html#9661" title="Poco::RefCountedObject::referenceCount()">referenceCount</a>, <a href="Poco.RefCountedObject.html#9660" title="Poco::RefCountedObject::release()">release</a></p>
<h2>Types</h2>
<h3><a name="15711">Ptr</a></h3>
<p class="decl">typedef <a href="Poco.AutoPtr.html" title="class Poco::AutoPtr">Poco::AutoPtr</a> &lt; <a href="Poco.Net.Context.html" title="class Poco::Net::Context">Context</a> &gt; <a href="Poco.Net.Context.html#15711" title="Poco::Net::Context::Ptr">Ptr</a>;</p>
<div class="description">
<p></p>
</div>
<h2>Enumerations</h2>
<h3><a name="15712">Usage</a></h3>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="15713">CLIENT_USE</a></p>
<div class="description">
<p><a href="Poco.Net.Context.html" title="class Poco::Net::Context">Context</a> is used by a client. </p>
</div>
<p class="decl"><a name="15714">SERVER_USE</a></p>
<div class="description">
<p><a href="Poco.Net.Context.html" title="class Poco::Net::Context">Context</a> is used by a server. </p>
</div>
<h3><a name="15715">VerificationMode</a></h3>
<div class="description">
<p></p>
</div>
<p class="decl"><a name="15716">VERIFY_NONE</a> = 0x00</p>
<div class="description">
<p>Server: The server will not send a client certificate  request to the client, so the client will not send a certificate.  </p>
<p>Client: If not using an anonymous cipher (by default disabled),  the server will send a certificate which will be checked, but the result of the check will be ignored. </p>
</div>
<p class="decl"><a name="15717">VERIFY_RELAXED</a> = 0x01</p>
<div class="description">
<p>Server: The server sends a client certificate request to the  client. The certificate returned (if any) is checked.  If the verification process fails, the TLS/SSL handshake is  immediately terminated with an alert message containing the  reason for the verification failure.  </p>
<p>Client: The server certificate is verified, if one is provided.  If the verification process fails, the TLS/SSL handshake is immediately terminated with an alert message containing the  reason for the verification failure.  </p>
</div>
<p class="decl"><a name="15718">VERIFY_STRICT</a> = 0x01 | 0x02</p>
<div class="description">
<p>Server: If the client did not return a certificate, the TLS/SSL  handshake is immediately terminated with a handshake failure alert.  </p>
<p>Client: Same as <a href="Poco.Net.Context.html#15717" title="Poco::Net::Context::VERIFY_RELAXED">VERIFY_RELAXED</a>.  </p>
</div>
<p class="decl"><a name="15719">VERIFY_ONCE</a> = 0x01 | 0x04</p>
<div class="description">
<p>Server: Only request a client certificate on the initial  TLS/SSL handshake. Do not ask for a client certificate  again in case of a renegotiation. </p>
<p>Client: Same as <a href="Poco.Net.Context.html#15717" title="Poco::Net::Context::VERIFY_RELAXED">VERIFY_RELAXED</a>.	 </p>
</div>
<h2>Constructors</h2>
<h3><a name="15720">Context</a></h3>
<p class="decl"><a href="Poco.Net.Context.html" title="class Poco::Net::Context">Context</a>(<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.Net.Context.html#15712" title="enum  Poco::Net::Context::Usage">Usage</a> usage,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; privateKeyFile,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; certificateFile,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; caLocation,<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.Net.Context.html#15715" title="enum  Poco::Net::Context::VerificationMode">VerificationMode</a> verificationMode = VERIFY_RELAXED,<br />&nbsp;&nbsp;&nbsp;&nbsp;int verificationDepth = 9,<br />&nbsp;&nbsp;&nbsp;&nbsp;bool loadDefaultCAs = false,<br />&nbsp;&nbsp;&nbsp;&nbsp;const std::string &amp; cipherList = "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH"<br />);</p>
<div class="description">
<p>Creates a <a href="Poco.Net.Context.html" title="class Poco::Net::Context">Context</a>. </p>
<p></p>
<ul>
<li>usage specifies whether the context is used by a client or server. </li>
<li>privateKeyFile contains the path to the private key file used for encryption. Can be empty if no private key file is used. </li>
<li>certificateFile contains the path to the certificate file (in PEM format). If the private key and the certificate are stored in the same file, this can be empty if privateKeyFile is given. </li>
<li>caLocation contains the path to the file or directory containing the CA/root certificates. Can be empty if the OpenSSL builtin CA certificates are used (see loadDefaultCAs). </li>
<li>verificationMode specifies whether and how peer certificates are validated. </li>
<li>verificationDepth sets the upper limit for verification chain sizes. Verification will fail if a certificate chain larger than this is encountered. </li>
<li>loadDefaultCAs specifies wheter the builtin CA certificates from OpenSSL are used. </li>
<li>cipherList specifies the supported ciphers in OpenSSL notation. </li>
</ul>
</div>
<h2>Destructor</h2>
<h3><a name="15729">~Context</a> <img src="images/virtual.gif" alt="virtual" title="virtual" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">~<a href="Poco.Net.Context.html" title="class Poco::Net::Context">Context</a>();</p>
<div class="description">
<p>Destroys the <a href="Poco.Net.Context.html" title="class Poco::Net::Context">Context</a>. </p>
</div>
<h2>Member Functions</h2>
<h3><a name="15733">enableSessionCache</a></h3>
<p class="decl">void enableSessionCache(<br />&nbsp;&nbsp;&nbsp;&nbsp;bool flag = true<br />);</p>
<div class="description">
<p>Enable or disable the SSL/TLS session cache for a server. </p>
<p>The default is a disabled session cache. </p>
</div>
<h3><a name="15735">sessionCacheEnabled</a></h3>
<p class="decl">bool sessionCacheEnabled() const;</p>
<div class="description">
<p>Returns true if and only if the session cache is enabled. </p>
</div>
<h3><a name="15730">sslContext</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">SSL_CTX * sslContext() const;</p>
<div class="description">
<p>Returns the underlying OpenSSL SSL <a href="Poco.Net.Context.html" title="class Poco::Net::Context">Context</a> object. </p>
</div>
<h3><a name="15731">usage</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Net.Context.html#15712" title="enum  Poco::Net::Context::Usage">Usage</a> usage() const;</p>
<div class="description">
<p>Returns whether the context is for use by a client or by a server. </p>
</div>
<h3><a name="15732">verificationMode</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.Net.Context.html#15715" title="enum  Poco::Net::Context::VerificationMode">Context::VerificationMode</a> verificationMode() const;</p>
<div class="description">
<p>Returns the verification mode. </p>
</div>
<p class="footer">POCO C++ Libraries 1.3.6-all<br />
Copyright &copy; 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p>

</div>
</body>
</html>