blob: b9dd056256e1c037c8e4ddbedfb4a1fdae77e362 (
plain)
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
---
version: tip
layout: manpage_v2
title: nng_tls_options(5)
---
<h1>nng_tls_options(5)</h1>
<div class="sect1">
<h2 id="_name">NAME</h2>
<div class="sectionbody">
<div class="paragraph">
<p>nng_tls_options - TLS-specific options</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_synopsis">SYNOPSIS</h2>
<div class="sectionbody">
<div class="listingblock">
<div class="content">
<pre class="pygments highlight"><code data-lang="c"><span></span><span class="tok-cp">#include</span><span class="tok-w"> </span><span class="tok-cpf"><nng/nng.h></span>
<span class="tok-cp">#define NNG_OPT_TLS_AUTH_MODE "tls-authmode"</span>
<span class="tok-cp">#define NNG_OPT_TLS_CA_FILE "tls-ca-file"</span>
<span class="tok-cp">#define NNG_OPT_TLS_CERT_KEY_FILE "tls-cert-key-file"</span>
<span class="tok-cp">#define NNG_OPT_TLS_CONFIG "tls-config"</span>
<span class="tok-cp">#define NNG_OPT_TLS_SERVER_NAME "tls-server-name"</span>
<span class="tok-cp">#define NNG_OPT_TLS_VERIFIED "tls-verified"</span>
<span class="tok-cp">#define NNG_OPT_TLS_PEER_CN "tls-peer-cn"</span>
<span class="tok-cp">#define NNG_OPT_TLS_PEER_ALT_NAMES "tls-peer-alt-names"</span></code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_description">DESCRIPTION</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This page documents the various standard options that can be set or
retrieved on objects using TLS.</p>
</div>
<div class="paragraph">
<p>The option names should always be used by their symbolic definitions.</p>
</div>
<div class="paragraph">
<p>In the following list of options, the name of the option is supplied,
along with the data type of the underlying value.</p>
</div>
<div class="paragraph">
<p>Some options are only meaningful or supported in certain contexts, or may
have other access restrictions.
An attempt has been made to include details about such restrictions in the
description of the option.</p>
</div>
<div class="sect2">
<h3 id="_tls_options">TLS Options</h3>
<div class="dlist">
<dl>
<dt class="hdlist1"><a id="NNG_OPT_TLS_AUTH_MODE"></a><code>NNG_OPT_TLS_AUTH_MODE</code></dt>
<dd>
<p>(<code>int</code>)
Write-only option used to configure the authentication mode used.
See <a href="nng_tls_config_auth_mode.3tls.html"><code>nng_tls_config_auth_mode()</code></a> for
more details.</p>
</dd>
<dt class="hdlist1"><a id="NNG_OPT_TLS_CA_FILE"></a><code>NNG_OPT_TLS_CA_FILE</code></dt>
<dd>
<p>(string) Write-only option naming a file containing certificates to
use for peer validation.
See <a href="nng_tls_config_ca_file.3tls.html"><code>nng_tls_config_ca_file()</code></a> for more
information.</p>
</dd>
<dt class="hdlist1"><a id="NNG_OPT_TLS_CERT_KEY_FILE"></a><code>NNG_OPT_TLS_CERT_KEY_FILE</code></dt>
<dd>
<p>(string) Write-only option naming a file containing the local certificate and
associated private key.
The private key used must be unencrypted.
See <a href="nng_tls_config_own_cert.3tls.html"><code>nng_tls_config_own_cert()</code></a> for more
information.</p>
</dd>
<dt class="hdlist1"><a id="NNG_OPT_TLS_CONFIG"></a><code>NNG_OPT_TLS_CONFIG</code></dt>
<dd>
<p>(<code>nng_tls_config *</code>)
This option references the underlying
<a href="nng_tls_config.5.html">TLS configuration object</a>.
A hold is placed on the underlying
configuration object before returning it.</p>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
The caller should release the hold with
<a href="nng_tls_config_free.3tls.html"><code>nng_tls_config_free()</code></a> when it no
longer needs the TLS configuration object.
</td>
</tr>
</table>
</div>
<div class="admonitionblock tip">
<table>
<tr>
<td class="icon">
<i class="fa icon-tip" title="Tip"></i>
</td>
<td class="content">
Use this option when more advanced TLS configuration is required.
</td>
</tr>
</table>
</div>
</dd>
<dt class="hdlist1"><a id="NNG_OPT_TLS_SERVER_NAME"></a><code>NNG_OPT_TLS_SERVER_NAME</code></dt>
<dd>
<p>(string)
This write-only option is used to specify the name of the server.
When used with a dialer, this potentially configures SNI (server name
indication, which is used as a hint by a multihosting server to choose the
appropriate certificate to provide) and also is used to validate the
name presented in the server’s x509 certificate.</p>
</dd>
<dt class="hdlist1"><a id="NNG_OPT_TLS_VERIFIED"></a><code>NNG_OPT_TLS_VERIFIED</code></dt>
<dd>
<p>(<code>bool</code>)
This read-only option indicates whether the remote peer has been properly verified using TLS
authentication.
May return incorrect results if peer authentication is disabled.</p>
</dd>
<dt class="hdlist1"><a id="NNG_OPT_TLS_PEER_CN"></a><code>NNG_OPT_TLS_PEER_CN</code></dt>
<dd>
<p>(string)
This read-only option returns the common name of the peer certificate.
May return incorrect results if peer authentication is disabled.</p>
</dd>
<dt class="hdlist1"><a id="NNG_OPT_TLS_PEER_ALT_NAMES"></a><code>NNG_OPT_TLS_PEER_ALT_NAMES</code></dt>
<dd>
<p>(string)
This read-only option returns string list with the subject alternative names of the
peer certificate. May return incorrect results if peer authentication is disabled.</p>
</dd>
</dl>
</div>
</div>
<div class="sect2">
<h3 id="_inherited_options">Inherited Options</h3>
<div class="paragraph">
<p>Generally, the following option values are also available for TLS objects,
when appropriate for the context:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><a href="nng_options.5.html#NNG_OPT_LOCADDR"><code>NNG_OPT_LOCADDR</code></a></p>
</li>
<li>
<p><a href="nng_options.5.html#NNG_OPT_REMADDR"><code>NNG_OPT_REMADDR</code></a></p>
</li>
<li>
<p><a href="nng_tcp_options.5.html#NNG_OPT_TCP_KEEPALIVE"><code>NNG_OPT_TCP_KEEPALIVE</code></a></p>
</li>
<li>
<p><a href="nng_tcp_options.5.html#NNG_OPT_TCP_NODELAY"><code>NNG_OPT_TCP_NODELAY</code></a></p>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_see_also">SEE ALSO</h2>
<div class="sectionbody">
<div class="paragraph text-left">
<p><a href="nng_options.5.html">nng_options(5)</a>
<a href="nng_tcp_options.5.html">nng_tcp_options(5)</a>
<a href="nng_tls_config.5.html">nng_tls_config(5)</a>,
<a href="nng.7.html">nng(7)</a></p>
</div>
</div>
</div>
|