| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>ProFTPD module mod_tls</title> |
| 5 | </head> |
| 6 | |
| 7 | <body bgcolor=white> |
| 8 | |
| 9 | <hr> |
| 10 | <center> |
| 11 | <h2><b>ProFTPD module <code>mod_tls</code></b></h2> |
| 12 | </center> |
| 13 | <hr><br> |
| 14 | |
| 15 | <p> |
| 16 | The <code>mod_tls</code> module implements FTP over SSL/TLS, known as FTPS. |
| 17 | |
| 18 | <p> |
| 19 | This module is contained in the <code>mod_tls.c</code> file for ProFTPD |
| 20 | 1.3.<i>x</i>, and is not compiled by default. Installation |
| 21 | instructions are discussed <a href="#Installation">here</a>. |
| 22 | |
| 23 | <p> |
| 24 | The most current version of <code>mod_tls</code> is distributed with the |
| 25 | ProFTPD source code. |
| 26 | |
| 27 | <p> |
| 28 | This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/). |
| 29 | |
| 30 | <p> |
| 31 | This product includes cryptographic software written by Eric Young ([email protected]). |
| 32 | |
| 33 | <h2>Author</h2> |
| 34 | <p> |
| 35 | Please contact TJ Saunders <tj <i>at</i> castaglia.org> with any |
| 36 | questions, concerns, or suggestions regarding this module. |
| 37 | |
| 38 | <h2>Thanks</h2> |
| 39 | <p> |
| 40 | <i>2002-09-01</i>: Thanks to Peter 'Luna' Runestig <peter <i>at</i> |
| 41 | runestig.com> for his original <code>mod_tls</code>, upon which this version |
| 42 | is based. His module can be found here: |
| 43 | <pre> |
| 44 | <a href="ftp://ftp.runestig.com/pub/proftpd-tls/">ftp://ftp.runestig.com/pub/proftpd-tls/</a> |
| 45 | </pre> |
| 46 | |
| 47 | <h2>Directives</h2> |
| 48 | <ul> |
| 49 | <li><a href="#TLSCACertificateFile">TLSCACertificateFile</a> |
| 50 | <li><a href="#TLSCACertificatePath">TLSCACertificatePath</a> |
| 51 | <li><a href="#TLSCARevocationFile">TLSCARevocationFile</a> |
| 52 | <li><a href="#TLSCARevocationPath">TLSCARevocationPath</a> |
| 53 | <li><a href="#TLSCertificateChainFile">TLSCertificateChainFile</a> |
| 54 | <li><a href="#TLSCipherSuite">TLSCipherSuite</a> |
| 55 | <li><a href="#TLSControlsACLs">TLSControlsACLs</a> |
| 56 | <li><a href="#TLSCryptoDevice">TLSCryptoDevice</a> |
| 57 | <li><a href="#TLSDHParamFile">TLSDHParamFile</a> |
| 58 | <li><a href="#TLSDSACertificateFile">TLSDSACertificateFile</a> |
| 59 | <li><a href="#TLSDSACertificateKeyFile">TLSDSACertificateKeyFile</a> |
| 60 | <li><a href="#TLSECCertificateFile">TLSECACertificateFile</a> |
| 61 | <li><a href="#TLSECCertificateKeyFile">TLSECCertificateKeyFile</a> |
| 62 | <li><a href="#TLSECDHCurve">TLSECDHCurve</a> |
| 63 | <li><a href="#TLSEngine">TLSEngine</a> |
| 64 | <li><a href="#TLSLog">TLSLog</a> |
| 65 | <li><a href="#TLSMasqueradeAddress">TLSMasqueradeAddress</a> |
| 66 | <li><a href="#TLSNextProtocol">TLSNextProtocol</a> |
| 67 | <li><a href="#TLSOptions">TLSOptions</a> |
| 68 | <li><a href="#TLSPKCS12File">TLSPKCS12File</a> |
| 69 | <li><a href="#TLSPassPhraseProvider">TLSPassPhraseProvider</a> |
| 70 | <li><a href="#TLSPreSharedKey">TLSPreSharedKey</a> |
| 71 | <li><a href="#TLSProtocol">TLSProtocol</a> |
| 72 | <li><a href="#TLSRandomSeed">TLSRandomSeed</a> |
| 73 | <li><a href="#TLSRenegotiate">TLSRenegotiate</a> |
| 74 | <li><a href="#TLSRequired">TLSRequired</a> |
| 75 | <li><a href="#TLSRSACertificateFile">TLSRSACertificateFile</a> |
| 76 | <li><a href="#TLSRSACertificateKeyFile">TLSRSACertificateKeyFile</a> |
| 77 | <li><a href="#TLSServerCipherPreference">TLSServerCipherPreference</a> |
| 78 | <li><a href="#TLSServerInfoFile">TLSServerInfoFile</a> |
| 79 | <li><a href="#TLSSessionCache">TLSSessionCache</a> |
| 80 | <li><a href="#TLSSessionTicketKeys">TLSSessionTicketKeys</a> |
| 81 | <li><a href="#TLSSessionTickets">TLSSessionTickets</a> |
| 82 | <li><a href="#TLSStapling">TLSStapling</a> |
| 83 | <li><a href="#TLSStaplingCache">TLSStaplingCache</a> |
| 84 | <li><a href="#TLSStaplingOptions">TLSStaplingOptions</a> |
| 85 | <li><a href="#TLSStaplingResponder">TLSStaplingResponder</a> |
| 86 | <li><a href="#TLSStaplingTimeout">TLSStaplingTimeout</a> |
| 87 | <li><a href="#TLSTimeoutHandshake">TLSTimeoutHandshake</a> |
| 88 | <li><a href="#TLSUserName">TLSUserName</a> |
| 89 | <li><a href="#TLSVerifyClient">TLSVerifyClient</a> |
| 90 | <li><a href="#TLSVerifyDepth">TLSVerifyDepth</a> |
| 91 | <li><a href="#TLSVerifyOrder">TLSVerifyOrder</a> |
| 92 | <li><a href="#TLSVerifyServer">TLSVerifyServer</a> |
| 93 | </ul> |
| 94 | |
| 95 | <h2>Control Actions</h2> |
| 96 | <ul> |
| 97 | <li><a href="#tls_sesscache_clear"><code>tls sesscache clear</code></a> |
| 98 | <li><a href="#tls_sesscache_info"><code>tls sesscache info</code></a> |
| 99 | <li><a href="#tls_sesscache_remove"><code>tls sesscache remove</code></a> |
| 100 | </ul> |
| 101 | |
| 102 | <hr> |
| 103 | <h3><a name="TLSCACertificateFile">TLSCACertificateFile</a></h3> |
| 104 | <strong>Syntax:</strong> TLSCACertificateFile <em>file</em><br> |
| 105 | <strong>Default:</strong> None<br> |
| 106 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 107 | <strong>Module:</strong> mod_tls<br> |
| 108 | <strong>Compatibility:</strong> 1.2.7rc1 and later |
| 109 | |
| 110 | <p> |
| 111 | The <code>TLSCACertificateFile</code> directive configures one file where you |
| 112 | can assemble the certificates of Certification Authorities (CA) for your |
| 113 | clients. The CA certificates in the file are then used to verify client |
| 114 | certificates, if presented. Such a file is merely the concatenation of the |
| 115 | various PEM-encoded CA certificates, in order of preference. This directive |
| 116 | can be used in addition to, or as an alternative for, |
| 117 | <code>TLSCACertificatePath</code>. |
| 118 | |
| 119 | <p> |
| 120 | Example: |
| 121 | <pre> |
| 122 | TLSCACertificateFile /etc/ftpd/ca-bundle.pem |
| 123 | </pre> |
| 124 | |
| 125 | <p> |
| 126 | If neither <code>TLSCACertificateFile</code> nor |
| 127 | <code>TLSCACertificatePath</code> are specified, the following message will |
| 128 | appear in the <code>TLSLog</code>: |
| 129 | <pre> |
| 130 | using default OpenSSL verification locations (see $SSL_CERT_DIR) |
| 131 | </pre> |
| 132 | This means that the <code>SSL_CERT_DIR</code> environment variable, if set, |
| 133 | will be used to determine the location of a CA certificate directory, to be |
| 134 | used when verifying clients. Note, though, that this directive is only |
| 135 | meaningful if <code>TLSVerifyClient</code> is set to <em>on</em> or |
| 136 | <em>optional</em>; otherwise, no client verification occurs. |
| 137 | |
| 138 | <p> |
| 139 | See also: <a href="#TLSCACertificatePath"><code>TLSCACertificatePath</code></a> |
| 140 | |
| 141 | <p> |
| 142 | <hr> |
| 143 | <h3><a name="TLSCACertificatePath">TLSCACertificatePath</a></h3> |
| 144 | <strong>Syntax:</strong> TLSCACertificatePath <em>directory</em><br> |
| 145 | <strong>Default:</strong> None<br> |
| 146 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 147 | <strong>Module:</strong> mod_tls<br> |
| 148 | <strong>Compatibility:</strong> 1.2.7rc1 and later |
| 149 | |
| 150 | <p> |
| 151 | The <code>TLSCACertificatePath</code> directive sets the directory for the |
| 152 | certificates of Certification Authorities (CAs) for your clients. These are |
| 153 | used to verify the client certificates presented. This directive may be used |
| 154 | in addition to, or as alternative for, <code>TLSCACertificateFile</code>. |
| 155 | |
| 156 | <p> |
| 157 | The files in the configured directory have to be PEM-encoded, and are accessed |
| 158 | through hash filenames. This means one cannot simply place the CA certificates |
| 159 | there: one also has to create symbolic links named <i>hash-value</i>.N. The |
| 160 | <code>c_rehash</code> utility that comes with OpenSSL can be used to create |
| 161 | the necessary symlinks. |
| 162 | |
| 163 | <p> |
| 164 | Example: |
| 165 | <pre> |
| 166 | TLSCACertificatePath /etc/ftpd/ca/ |
| 167 | </pre> |
| 168 | |
| 169 | <p> |
| 170 | If neither <code>TLSCACertificateFile</code> nor |
| 171 | <code>TLSCACertificatePath</code> are specified, the following message will |
| 172 | appear in the <code>TLSLog</code>: |
| 173 | <pre> |
| 174 | using default OpenSSL verification locations (see $SSL_CERT_DIR) |
| 175 | </pre> |
| 176 | This means that the <code>SSL_CERT_DIR</code> environment variable, if set, |
| 177 | will be used to determine the location of a CA certificate directory, to be |
| 178 | used when verifying clients. |
| 179 | |
| 180 | <p> |
| 181 | See also: <a href="#TLSCACertificateFile"><code>TLSCACertificateFile</code></a> |
| 182 | |
| 183 | <p> |
| 184 | <hr> |
| 185 | <h3><a name="TLSCARevocationFile">TLSCARevocationFile</a></h3> |
| 186 | <strong>Syntax:</strong> TLSCARevocationFile <em>file</em><br> |
| 187 | <strong>Default:</strong> None<br> |
| 188 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 189 | <strong>Module:</strong> mod_tls<br> |
| 190 | <strong>Compatibility:</strong> 1.2.7rc1 and later |
| 191 | |
| 192 | <p> |
| 193 | The <code>TLSCARevocationFile</code> directive configures one file that can |
| 194 | contain the Certificate Revocation Lists (CRL) of Certification Authorities |
| 195 | (CA) for your clients. These CRLs are used during the verification of client |
| 196 | certificates, if presented. Such a file is merely the concatenation of the |
| 197 | various PEM-encoded CRL files, in order of preference. This directive can be |
| 198 | used in addition to, or as an alternative for, <code>TLSCARevocationPath</code>. |
| 199 | |
| 200 | <p> |
| 201 | Example: |
| 202 | <pre> |
| 203 | TLSCARevocationFile /etc/ftpd/ca-crl-bundle.pem |
| 204 | </pre> |
| 205 | |
| 206 | <p> |
| 207 | See also: <a href="#TLSCARevocationPath"><code>TLSCARevocationPath</code></a> |
| 208 | |
| 209 | <p> |
| 210 | <hr> |
| 211 | <h3><a name="TLSCARevocationPath">TLSCARevocationPath</a></h3> |
| 212 | <strong>Syntax:</strong> TLSCARevocationPath <em>directory</em><br> |
| 213 | <strong>Default:</strong> None<br> |
| 214 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 215 | <strong>Module:</strong> mod_tls<br> |
| 216 | <strong>Compatibility:</strong> 1.2.7rc1 and later |
| 217 | |
| 218 | <p> |
| 219 | The <code>TLSCARevocationPath</code> directive sets the directory for the |
| 220 | Certificate Revocation Lists (CRL) of Certification Authorities (CAs) for your |
| 221 | clients. These are used during the verification of client certificates, if |
| 222 | presented. This directive may be used in addition to, or as alternative for, |
| 223 | <code>TLSCARevocationFile</code>. |
| 224 | |
| 225 | <p> |
| 226 | The files in the configured directory have to be PEM-encoded, and are accessed |
| 227 | through hash filenames. This means one cannot simply place the CRLs there: |
| 228 | one also has to create symbolic links named <i>hash-value</i>.N. The |
| 229 | <code>c_rehash</code> utility that comes with OpenSSL can be used to create |
| 230 | the necessary symlinks. |
| 231 | |
| 232 | <p> |
| 233 | Example: |
| 234 | <pre> |
| 235 | TLSCARevocationPath /etc/ftpd/crl/ |
| 236 | </pre> |
| 237 | |
| 238 | <p> |
| 239 | See also: <a href="#TLSCARevocationFile"><code>TLSCARevocationFile</code></a> |
| 240 | |
| 241 | <p> |
| 242 | <hr> |
| 243 | <h3><a name="TLSCertificateChainFile">TLSCertificateChainFile</a></h3> |
| 244 | <strong>Syntax:</strong> TLSCertificateChainFile <em>file</em><br> |
| 245 | <strong>Default:</strong> None<br> |
| 246 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 247 | <strong>Module:</strong> mod_tls<br> |
| 248 | <strong>Compatibility:</strong> 1.2.7rc1 and later |
| 249 | |
| 250 | <p> |
| 251 | The <code>TLSCertificateChainFile</code> directive sets the optional |
| 252 | all-in-one file where you can assemble the certificates of Certification |
| 253 | Authorities (CA) which form the certificate chain of the server certificate. |
| 254 | This starts with the issuing CA certificate of the server certificate and can |
| 255 | range up to the root CA certificate. Such a file is simply the concatenation |
| 256 | of the various PEM-encoded CA Certificate files in certificate chain order. |
| 257 | (<em>Certificate chain order</em> means that the list must be sorted starting |
| 258 | with the subject's certificate (actual server certificate), followed by |
| 259 | intermediate CA certificates if applicable, and ending at the highest level |
| 260 | root CA.) This server certificate chain is sent to the client, in addition to |
| 261 | the server's certificate. |
| 262 | |
| 263 | <p> |
| 264 | If <code>TLSCertificateChainFile</code> is not used, and |
| 265 | <code>TLSCACertificatePath</code> is used, the certificate chain is built from |
| 266 | the certificates in that path. <code>TLSCertificateChainFile</code> should be |
| 267 | used as an alternative to <code>TLSCACertificatePath</code> for explicitly |
| 268 | constructing the server certificate chain. It is especially useful to avoid |
| 269 | conflicts with CA certificates when using client authentication. For although |
| 270 | placing a CA certificate of the server certificate chain into |
| 271 | the <code>TLSCACertificatePath</code> has the same effect for the certificate |
| 272 | chain construction, it has the side-effect that client certificates issued by |
| 273 | this same CA certificate are also accepted on client authentication. This |
| 274 | is usually <i>not</i> what one expects. |
| 275 | |
| 276 | <p> |
| 277 | Be careful: providing the certificate chain works only if you are using a |
| 278 | single (either RSA or DSA) based server certificate. If you are using a coupled |
| 279 | RSA+DSA certificate pair, this will work only if actually both certificates |
| 280 | use the same certificate chain. Otherwise, clients will become confused. |
| 281 | |
| 282 | <p> |
| 283 | Example: |
| 284 | <pre> |
| 285 | TLSCertificateChainFile /etc/ftpd/client-ca-list.pem |
| 286 | </pre> |
| 287 | |
| 288 | <p> |
| 289 | <hr> |
| 290 | <h3><a name="TLSCipherSuite">TLSCipherSuite</a></h3> |
| 291 | <strong>Syntax:</strong> TLSCipherSuite <em>[protocol] cipher-list</em><br> |
| 292 | <strong>Default:</strong> DEFAULT:!ADH:!EXPORT:!DES<br> |
| 293 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 294 | <strong>Module:</strong> mod_tls<br> |
| 295 | <strong>Compatibility:</strong> 1.2.7rc1 and later |
| 296 | |
| 297 | <p> |
| 298 | Sets the list of SSL/TLS ciphersuites for use. Default cipher list is |
| 299 | "DEFAULT:!ADH:!EXPORT:!DES". |
| 300 | |
| 301 | <p> |
| 302 | <b>Note</b> that <code>mod_tls</code> will automatically <i>prepend</i> the |
| 303 | configured <em>cipher-list</em> with "!EXPORT", in order to <i>prevent</i> the |
| 304 | use of the insecure "export grade" ciphers. |
| 305 | |
| 306 | <p> |
| 307 | If the SSL library supports TLSv1.3 (<i>e.g.</i> OpenSSL-1.1.1 and later), the |
| 308 | <em>protocol specifier</em> "TLSv1.3" can be used to configure the cipher |
| 309 | suites for that protocol: |
| 310 | <pre> |
| 311 | TLSProtocol TLSv1.2 TLSv1.3 |
| 312 | |
| 313 | # Configure ciphersuites for TLSv1.2 and older protocols |
| 314 | TLSCipherSuite TLSv1.2 ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:... |
| 315 | |
| 316 | # Configure TLSv1.3 ciphersuites separately |
| 317 | TLSCipherSuite TLSv1.3 TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384:TLS_AES_128_GCM_SHA256 |
| 318 | </pre> |
| 319 | |
| 320 | <p> |
| 321 | How to put together a <em>cipher list</em> parameter: |
| 322 | <pre> |
| 323 | Key Exchange Algorithms: |
| 324 | "kRSA" RSA key exchange |
| 325 | "kDHr" Diffie-Hellman key exchange (key from RSA cert) |
| 326 | "kDHd" Diffie-Hellman key exchange (key from DSA cert) |
| 327 | "kEDH' Ephemeral Diffie-Hellman key exchange (temporary key) |
| 328 | |
| 329 | Authentication Algorithm: |
| 330 | "aNULL" No authentication |
| 331 | "aRSA" RSA authentication |
| 332 | "aDSS" DSS authentication |
| 333 | "aDH" Diffie-Hellman authentication |
| 334 | |
| 335 | Cipher Encoding Algorithm: |
| 336 | "eNULL" No encodiing |
| 337 | "DES" DES encoding |
| 338 | "3DES" Triple DES encoding |
| 339 | "RC4" RC4 encoding |
| 340 | "RC2" RC2 encoding |
| 341 | "IDEA" IDEA encoding |
| 342 | |
| 343 | MAC Digest Algorithm: |
| 344 | "MD5" MD5 hash function |
| 345 | "SHA1" SHA1 hash function |
| 346 | "SHA256" SHA-256 hash function |
| 347 | "SHA384" SHA-384 hash function |
| 348 | "SHA512" SHA-512 hash function |
| 349 | "SHA" SHA hash function (should not be used) |
| 350 | |
| 351 | Aliases: |
| 352 | "ALL" all ciphers |
| 353 | "SSLv2" all SSL version 2.0 ciphers (should not be used) |
| 354 | "SSLv3" all SSL version 3.0 ciphers |
| 355 | "TLSv1" all TLS version 1.0 ciphers |
| 356 | "ECDH" all ciphers using Elliptic Curve Diffie-Hellman key exchange |
| 357 | "EXP" all export ciphers (40-bit) |
| 358 | "EXPORT56" all export ciphers (56-bit) |
| 359 | "LOW" all low strength ciphers (no export) |
| 360 | "MEDIUM" all ciphers with 128-bit encryption |
| 361 | "HIGH" all ciphers using greater than 128-bit encryption |
| 362 | "RSA" all ciphers using RSA key exchange |
| 363 | "DH" all ciphers using Diffie-Hellman key exchange |
| 364 | "EDH" all ciphers using Ephemeral Diffie-Hellman key exchange |
| 365 | "ADH" all ciphers using Anonymous Diffie-Hellman key exchange |
| 366 | "DSS" all ciphers using DSS authentication |
| 367 | "NULL" all ciphers using no encryption |
| 368 | </pre> |
| 369 | |
| 370 | <p> |
| 371 | Each item in the list may include a prefix modifier: |
| 372 | <pre> |
| 373 | "+" move cipher(s) to the current location in the list |
| 374 | "-" remove cipher(s) from the list (may be added again by a |
| 375 | subsequent list entry) |
| 376 | "!" kill cipher from the list (it may not be added again by a |
| 377 | subsequent list entry) |
| 378 | </pre> |
| 379 | |
| 380 | <p> |
| 381 | If no modifier is specified the entry is added to the list at the current |
| 382 | position. "+" may also be used to combine tags to specify entries |
| 383 | such as "RSA+RC4" describes all ciphers that use both RSA and RC4. |
| 384 | |
| 385 | <p> |
| 386 | For example, all available ciphers not including ADH key exchange: |
| 387 | <pre> |
| 388 | ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP |
| 389 | </pre> |
| 390 | |
| 391 | <p> |
| 392 | All algorithms including ADH and export but excluding patented algorithms: |
| 393 | <pre> |
| 394 | HIGH:MEDIUM:LOW:EXPORT56:EXP:ADH:!kRSA:!aRSA:!RC4:!RC2:!IDEA |
| 395 | </pre> |
| 396 | |
| 397 | <p> |
| 398 | The OpenSSL command |
| 399 | <pre> |
| 400 | $ openssl ciphers -v <em><list of ciphers></em> |
| 401 | </pre> |
| 402 | may be used to list all of the ciphers and the order described by a specific |
| 403 | <em><list of ciphers></em>. |
| 404 | |
| 405 | <p> |
| 406 | <hr> |
| 407 | <h3><a name="TLSControlsACLs">TLSControlsACLs</a></h3> |
| 408 | <strong>Syntax:</strong> TLSControlsACLs <em>actions|"all" "allow"|"deny" "user"|"group" list</em><br> |
| 409 | <strong>Default:</strong> None<br> |
| 410 | <strong>Context:</strong> server config<br> |
| 411 | <strong>Module:</strong> mod_tls<br> |
| 412 | <strong>Compatibility:</strong> 1.3.3rc1 and later |
| 413 | |
| 414 | <p> |
| 415 | The <code>TLSControlsACLs</code> directive configures access lists of |
| 416 | <em>users</em> or <em>groups</em> who are allowed (or denied) the ability to |
| 417 | use the <em>actions</em> implemented by <code>mod_tls</code>. The default |
| 418 | behavior is to deny everyone unless an ACL allowing access has been explicitly |
| 419 | configured. |
| 420 | |
| 421 | <p> |
| 422 | If "allow" is used, then <em>list</em>, a comma-delimited list |
| 423 | of <em>users</em> or <em>groups</em>, can use the given <em>actions</em>; all |
| 424 | others are denied. If "deny" is used, then the <em>list</em> of |
| 425 | <em>users</em> or <em>groups</em> cannot use <em>actions</em> all others are |
| 426 | allowed. Multiple <code>TLSControlsACLs</code> directives may be used to |
| 427 | configure ACLs for different control actions, and for both users and groups. |
| 428 | |
| 429 | <p> |
| 430 | The <em>actions</em> provided by <code>mod_tls</code> are |
| 431 | "sesscache clear" , "sesscache info", and |
| 432 | "sesscache remove". |
| 433 | |
| 434 | <p> |
| 435 | Examples: |
| 436 | <pre> |
| 437 | # Allow only user root to examine/update the external SSL session cache |
| 438 | TLSControlsACLs all allow user root |
| 439 | </pre> |
| 440 | |
| 441 | <p> |
| 442 | <hr> |
| 443 | <h3><a name="TLSCryptoDevice">TLSCryptoDevice</a></h3> |
| 444 | <strong>Syntax:</strong> TLSCryptoDevice <em>driver|"all"|"none"</em><br> |
| 445 | <strong>Default:</strong> None<br> |
| 446 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 447 | <strong>Module:</strong> mod_tls<br> |
| 448 | <strong>Compatibility:</strong> 1.3.1rc1 and later |
| 449 | |
| 450 | <p> |
| 451 | The <code>TLSCryptoDevice</code> directive is used to configure |
| 452 | <code>mod_tls</code> to use an OpenSSL "engine", a cryptographic module |
| 453 | that OpenSSL library can use for accelerated cryptographic support, or |
| 454 | HSM keys, <i>etc</i>. |
| 455 | |
| 456 | <p> |
| 457 | To use all of the engines compiled into OpenSSL, use: |
| 458 | <pre> |
| 459 | TLSCryptoDevice all |
| 460 | </pre> |
| 461 | OpenSSL will find, from the list of supported engines, the first one |
| 462 | usable, if any. If no usable engines are found, OpenSSL will default to |
| 463 | its normal software implementation. If a specific engine is desired as |
| 464 | the default engine to use, specify the engine name, <i>e.g.</i>: |
| 465 | <pre> |
| 466 | TLSCryptoDevice chil |
| 467 | </pre> |
| 468 | |
| 469 | <p> |
| 470 | The OpenSSL command |
| 471 | <pre> |
| 472 | $ openssl engine |
| 473 | </pre> |
| 474 | may be used to list all of the engine drivers supported by OpenSSL. |
| 475 | |
| 476 | <p> |
| 477 | <hr> |
| 478 | <h3><a name="TLSDHParamFile">TLSDHParamFile</a></h3> |
| 479 | <strong>Syntax:</strong> TLSDHParamFile <em>file</em><br> |
| 480 | <strong>Default:</strong> None<br> |
| 481 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 482 | <strong>Module:</strong> mod_tls<br> |
| 483 | <strong>Compatibility:</strong> 1.2.7rc1 and later |
| 484 | |
| 485 | <p> |
| 486 | The <code>TLSDHParamFile</code> directive is used to configure a file that |
| 487 | contains pre-computed Diffie-Hellman (DH) group parameters. The |
| 488 | <code>mod_tls</code> module will use these parameters when engaging in |
| 489 | Diffie-Hellman key exchanges. |
| 490 | |
| 491 | <p> |
| 492 | Such key exchanges can be computationally intensive, in terms for parameter |
| 493 | generation. To help speed up the process and avoid latency for Diffie-Hellman |
| 494 | key exchanges, the DH group parameters used may be generated in advance, and |
| 495 | stored in a <code>TLSDHParamFile</code>. The <code>dhparam</code> utility |
| 496 | that comes with OpenSSL may be used to generate an appropriate file for this |
| 497 | directive: |
| 498 | <pre> |
| 499 | $ openssl dhparam -outform PEM -2 <i>nbits</i> >> dhparams.pem |
| 500 | $ openssl dhparam -outform PEM -5 <i>nbits</i> >> dhparams.pem |
| 501 | </pre> |
| 502 | Using either -2 or -5 as the generator is fine. The <em>nbits</em> value used |
| 503 | should vary between 512 and 4096, inclusive. |
| 504 | |
| 505 | <p> |
| 506 | The <em>file</em> parameter must be an absolute path. |
| 507 | |
| 508 | <p> |
| 509 | <b>Note</b> that as of <code>proftpd-1.3.6rc1</code> and later, for |
| 510 | Diffie-Hellman key exchanges, <code>mod_tls</code> will generate DH parameters |
| 511 | that match the size of the server certificate's RSA/DSA key. Some clients, |
| 512 | such as Java 7 (and earlier) code, cannot handle DH parameter lengths greater |
| 513 | than 1024 bits; see this <a href="#TLSJavaDH">FAQ</a> for a workaround for such |
| 514 | clients. |
| 515 | |
| 516 | <p> |
| 517 | <hr> |
| 518 | <h3><a name="TLSDSACertficateFile">TLSDSACertficateFile</a></h3> |
| 519 | <strong>Syntax:</strong> TLSDSACertificateFile <em>file</em><br> |
| 520 | <strong>Default:</strong> None<br> |
| 521 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 522 | <strong>Module:</strong> mod_tls<br> |
| 523 | <strong>Compatibility:</strong> 1.2.7rc1 and later |
| 524 | |
| 525 | <p> |
| 526 | The <code>TLSDSACertificateFile</code> directive points to the PEM-encoded |
| 527 | file containing the DSA certificate file for the server and optionally also |
| 528 | the corresponding DSA private key file. |
| 529 | |
| 530 | <p> |
| 531 | If the contained private key is encrypted, the administrator will be |
| 532 | prompted for the passphrase when the daemon starts up, and when the daemon |
| 533 | is restarted. Alternatively, the <code>TLSPassPhraseProvider</code> |
| 534 | directive can be used to supply a source for that passphrase. |
| 535 | |
| 536 | <p> |
| 537 | Example: |
| 538 | <pre> |
| 539 | TLSDSACertificateFile /etc/ftpd/server-dsa-cert.pem |
| 540 | </pre> |
| 541 | |
| 542 | <p> |
| 543 | <hr> |
| 544 | <h3><a name="TLSDSACertificateKeyFile">TLSDSACertificateKeyFile</a></h3> |
| 545 | <strong>Syntax:</strong> TLSDSACertificateKeyFile <em>file</em><br> |
| 546 | <strong>Default:</strong> None<br> |
| 547 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 548 | <strong>Module:</strong> mod_tls<br> |
| 549 | <strong>Compatibility:</strong> 1.2.7rc1 and later |
| 550 | |
| 551 | <p> |
| 552 | The <code>TLSDSACertificateKeyFile</code> directive points to the PEM-encoded |
| 553 | private key file for the server. If the private key is not combined with the |
| 554 | certificate in the <code>TLSDSACertificateFile</code>, use this additional |
| 555 | directive to point to the file with the standalone private key. When |
| 556 | <code>TLSDSACertificateFile</code> is used and the file contains both the |
| 557 | certificate and the private key, this directive need not be used. However, |
| 558 | this practice is strongly discouraged. Instead we recommend you to separate |
| 559 | the certificate and the private key. |
| 560 | |
| 561 | <p> |
| 562 | If the contained private key is encrypted, the administrator will be |
| 563 | prompted for the passphrase when the daemon starts up, and when the daemon |
| 564 | is restarted. |
| 565 | |
| 566 | <p> |
| 567 | Example: |
| 568 | <pre> |
| 569 | TLSDSACertificateKeyFile /etc/ftpd/server-dsa-key.pem |
| 570 | </pre> |
| 571 | |
| 572 | <p> |
| 573 | <hr> |
| 574 | <h3><a name="TLSECCertificateFile">TLSECCertificateFile</a></h3> |
| 575 | <strong>Syntax:</strong> TLSECCertificateFile <em>file</em><br> |
| 576 | <strong>Default:</strong> None<br> |
| 577 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 578 | <strong>Module:</strong> mod_tls<br> |
| 579 | <strong>Compatibility:</strong> 1.3.5rc4 and later |
| 580 | |
| 581 | <p> |
| 582 | The <code>TLSECCertificateFile</code> directive points to the PEM-encoded |
| 583 | file containing the EC certificate file for the server and optionally also |
| 584 | the corresponding EC private key file. |
| 585 | |
| 586 | <p> |
| 587 | If the contained private key is encrypted, the administrator will be |
| 588 | prompted for the passphrase when the daemon starts up, and when the daemon |
| 589 | is restarted. Alternatively, the <code>TLSPassPhraseProvider</code> |
| 590 | directive can be used to supply a source for that passphrase. |
| 591 | |
| 592 | <p> |
| 593 | Example: |
| 594 | <pre> |
| 595 | TLSECCertificateFile /etc/ftpd/server-ec-cert.pem |
| 596 | </pre> |
| 597 | |
| 598 | <p> |
| 599 | <hr> |
| 600 | <h3><a name="TLSECCertificateKeyFile">TLSECCertificateKeyFile</a></h3> |
| 601 | <strong>Syntax:</strong> TLSECCertificateKeyFile <em>file</em><br> |
| 602 | <strong>Default:</strong> None<br> |
| 603 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 604 | <strong>Module:</strong> mod_tls<br> |
| 605 | <strong>Compatibility:</strong> 1.3.5rc4 and later |
| 606 | |
| 607 | <p> |
| 608 | The <code>TLSECCertificateKeyFile</code> directive points to the PEM-encoded |
| 609 | private key file for the server. If the private key is not combined with the |
| 610 | certificate in the <code>TLSECCertificateFile</code>, use this additional |
| 611 | directive to point to the file with the standalone private key. When |
| 612 | <code>TLSECCertificateFile</code> is used and the file contains both the |
| 613 | certificate and the private key, this directive need not be used. However, |
| 614 | this practice is strongly discouraged. Instead we recommend you to separate |
| 615 | the certificate and the private key. |
| 616 | |
| 617 | <p> |
| 618 | If the contained private key is encrypted, the administrator will be |
| 619 | prompted for the passphrase when the daemon starts up, and when the daemon |
| 620 | is restarted. |
| 621 | |
| 622 | <p> |
| 623 | Example: |
| 624 | <pre> |
| 625 | TLSECCertificateKeyFile /etc/ftpd/server-ec-key.pem |
| 626 | </pre> |
| 627 | |
| 628 | <p> |
| 629 | <hr> |
| 630 | <h3><a name="TLSECDHCurve">TLSECDHCurve</a></h3> |
| 631 | <strong>Syntax:</strong> TLSECDHCurve <em>curve</em><br> |
| 632 | <strong>Default:</strong> TLSECDHCurve prime256v1<br> |
| 633 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 634 | <strong>Module:</strong> mod_tls<br> |
| 635 | <strong>Compatibility:</strong> 1.3.6rc1 and later |
| 636 | |
| 637 | <p> |
| 638 | The <code>TLSECDHCurve</code> directive specifies the EC curve to use for |
| 639 | ECDHE ciphers. To see the full list of curves supported by your OpenSSL |
| 640 | library, use: |
| 641 | <pre> |
| 642 | $ openssl ecparam -list_curves |
| 643 | </pre> |
| 644 | |
| 645 | <p> |
| 646 | If you are using OpenSSL 1.0.2 or later, then you can specify multiple curve |
| 647 | names as a colon-separated list, <i>e.g.</i>: |
| 648 | <pre> |
| 649 | TLSECDHCurve secp521r1:prime256v1 |
| 650 | </pre> |
| 651 | |
| 652 | <p> |
| 653 | <hr> |
| 654 | <h3><a name="TLSEngine">TLSEngine</a></h3> |
| 655 | <strong>Syntax:</strong> TLSEngine <em>on|off</em><br> |
| 656 | <strong>Default:</strong> off<br> |
| 657 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 658 | <strong>Module:</strong> mod_tls<br> |
| 659 | <strong>Compatibility:</strong> 1.2.7rc1 and later |
| 660 | |
| 661 | <p> |
| 662 | The <code>TLSEngine</code> directive toggles the use of the SSL/TLS protocol |
| 663 | engine (<i>e.g.</i> <code>mod_tls</code>). This is usually used inside a |
| 664 | <code><VirtualHost></code> section to enable SSL/TLS sessions for a |
| 665 | particular virtual host. By default <code>mod_tls</code> is disabled for both |
| 666 | the main server and all configured virtual hosts. |
| 667 | |
| 668 | <p> |
| 669 | <hr> |
| 670 | <h3><a name="TLSLog">TLSLog</a></h3> |
| 671 | <strong>Syntax:</strong> TLSLog <em>file</em><br> |
| 672 | <strong>Default:</strong> None<br> |
| 673 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 674 | <strong>Module:</strong> mod_tls<br> |
| 675 | <strong>Compatibility:</strong> 1.2.7rc1 and later |
| 676 | |
| 677 | <p> |
| 678 | The <code>TLSLog</code> directive is used to specify a log file for |
| 679 | <code>mod_tls</code>'s reporting on a per-server basis. The <em>file</em> |
| 680 | parameter given must be the full path to the file to use for logging. |
| 681 | |
| 682 | <p> |
| 683 | Note that this path must <b>not</b> be to a world-writable directory and, |
| 684 | unless <code>AllowLogSymlinks</code> is explicitly set to <em>on</em> |
| 685 | (generally a bad idea), the path must <b>not</b> be a symbolic link. |
| 686 | |
| 687 | <p> |
| 688 | <hr> |
| 689 | <h3><a name="TLSMasqueradeAddress">TLSMasqueradeAddress</a></h3> |
| 690 | <strong>Syntax:</strong> TLSMasqueradeAddress <em>ip-address|dns-name|device-name</em><br> |
| 691 | <strong>Default:</strong> None<br> |
| 692 | <strong>Context:</strong> server config, <code><VirtualHost></code><br> |
| 693 | <strong>Module:</strong> mod_tls<br> |
| 694 | <strong>Compatibility:</strong> 1.3.5rc2 and later |
| 695 | |
| 696 | <p> |
| 697 | The <code>TLSMasqueradeAddress</code> directive functions exactly like the |
| 698 | <a href="../modules/mod_core.html#MasqueradeAddress"><code>MasqueradeAddress</code></a>, except that it applies <b>only to FTPS sessions</b>. (Note that if |
| 699 | <em>both</em> <code>MasqueradeAddress</code> <b>and</b> |
| 700 | <code>TLSMasqueradeAddress</code> are configured, then the |
| 701 | <code>TLSMasqueradeAddress</code> directive will take precedence, but only |
| 702 | for FTPS sessions.) |
| 703 | |
| 704 | <p> |
| 705 | <b><i>Discussion</i></b><br> |
| 706 | Why is something like <code>TLSMasqueradeAddress</code> needed? There are |
| 707 | cases where some sites run <code>proftpd</code> within a restricted VLAN/DMZ, |
| 708 | with some sort of firewall/proxy/router device which handles FTP and FTPS |
| 709 | connections from the Internet to that <code>proftpd</code> server: |
| 710 | <pre> |
| 711 | <i>client</i> <---> <i>firewall</i> <---> <i>load balancer</i> <---> <i>server</i> |
| 712 | </pre> |
| 713 | In many cases, the firewall/proxy/router device will look at the FTP responses |
| 714 | for the <code>PASV</code>/<code>EPSV</code> commands (in which |
| 715 | <code>proftpd</code> may be sending its internal, non-public IP address), and |
| 716 | rewrite the responses to have the IP address of the firewall/proxy/router |
| 717 | device. |
| 718 | |
| 719 | <p> |
| 720 | Normally, the <code>MasqueradeAddress</code> directive can be used for such |
| 721 | cases, so that <code>proftpd</code> sends the configured address in the |
| 722 | <code>PASV</code>/<code>EPSV</code> responses. With that configuration, |
| 723 | the firewall/proxy/router device will not need to rewrite the responses. |
| 724 | And this approach works for FTPS sessions as well, where the |
| 725 | firewall/proxy/router device <b><i>cannot</i></b> rewrite the response due to |
| 726 | the SSL/TLS protection. |
| 727 | |
| 728 | <p> |
| 729 | Sometimes, though, sites <b>want</b> their firewall/proxy/router device to be |
| 730 | able to properly rewrite FTP responses. But due to bugs/implementation details |
| 731 | in the firewall/proxy/router devices, <i>if</i> a |
| 732 | <code>PASV</code>/<code>EPSV</code> response contains a public IP address, the |
| 733 | device will drop/break that FTP connection. |
| 734 | |
| 735 | <p> |
| 736 | This leaves the site in a case where it does <b>not</b> want to use |
| 737 | <code>MasqueradeAddress</code> (so that the device can properly rewrite FTP |
| 738 | responses), which works -- but only for plain FTP sessions. Yet the site |
| 739 | <b>does</b> want to use <code>MasqueradeAddress</code> -- but only for FTPS |
| 740 | sessions, since the device cannot rewrite FTPS responses. |
| 741 | |
| 742 | <p> |
| 743 | For these situations, then, the <code>TLSMasqueradeAddress</code> directive |
| 744 | can/should be used: it provides <code>MasqueradeAddress</code> functionality, |
| 745 | but only for FTPS sessions. |
| 746 | |
| 747 | <p> |
| 748 | <hr> |
| 749 | <h3><a name="TLSNextProtocol">TLSNextProtocol</a></h3> |
| 750 | <strong>Syntax:</strong> TLSNextProtocol <em>on|off</em><br> |
| 751 | <strong>Default:</strong> TLSNextProtocol on<br> |
| 752 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 753 | <strong>Module:</strong> mod_tls<br> |
| 754 | <strong>Compatibility:</strong> 1.3.6rc1 and later |
| 755 | |
| 756 | <p> |
| 757 | The <code>TLSNextProtocol</code> directive toggles <code>mod_tls</code>' support |
| 758 | for the <a href="http://en.wikipedia.org/wiki/Application-Layer_Protocol_Negotiation">ALPN</a> (and NPN) TLS extensions. These extensions are used to negotiate |
| 759 | the "next protocol" that will be once the SSL/TLS session is established; in |
| 760 | the case of <code>mod_tls</code>, that "next protocol" is <b>always</b> "ftp". |
| 761 | |
| 762 | <p> |
| 763 | Some FTPS clients use the support of ALPN/NPN as a heuristic for knowing when |
| 764 | to use <a href="https://technotes.googlecode.com/git/falsestart.html">TLS False Start</a>, which can reduce the SSL/TLS handshake network latency. Initially |
| 765 | TLS clients used TLS False Start for any/all sites, but encountered |
| 766 | <a href="https://www.imperialviolet.org/2012/04/11/falsestart.html">issues</a>; |
| 767 | these clients (<i>e.g.</i> Chrome, Firefox, perhaps others) now only use |
| 768 | the TLS False Start optimization for ALPN/NPN-enabled SSL/TLS servers. |
| 769 | |
| 770 | <p> |
| 771 | <hr> |
| 772 | <h3><a name="TLSOptions">TLSOptions</a></h3> |
| 773 | <strong>Syntax:</strong> TLSOptions <em>opt1 ...</em><br> |
| 774 | <strong>Default:</strong> None<br> |
| 775 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 776 | <strong>Module:</strong> mod_tls<br> |
| 777 | <strong>Compatibility:</strong> 1.2.7rc1 and later |
| 778 | |
| 779 | <p> |
| 780 | The <code>TLSOptions</code> directive is used to configure various optional |
| 781 | behavior of <code>mod_tls</code>. |
| 782 | |
| 783 | <p> |
| 784 | Example: |
| 785 | <pre> |
| 786 | TLSOptions iPAddressRequired StdEnvVars NoSessionReuseRequired |
| 787 | </pre> |
| 788 | |
| 789 | <p> |
| 790 | The currently implemented options are: |
| 791 | <ul> |
| 792 | <li><code>AllowClientRenegotiations</code><br> |
| 793 | <p> |
| 794 | The <code>mod_tls</code> will reject any SSL/TLS session renegotiation |
| 795 | attempts by the client, in order to mitigate any issues arising from the |
| 796 | <a href="http://www.educatedguesswork.org/2009/11/understanding_the_tls_renegoti.html">SSL/TLS session renegotiation vulnerability</a> (CVE-2009-3555) |
| 797 | or <a href="http://www.ietf.org/mail-archive/web/tls/current/msg07553.html">SSL/TLS session renegotiation DoS</a> (CVE-2011-1473). If, however, your |
| 798 | particular site or clients absolutely require support for client-initiated |
| 799 | SSL/TLS session renegotiations, then this option can be used. |
| 800 | <b>Not recommended.</b> |
| 801 | |
| 802 | <p> |
| 803 | Note, however, that SSL/TLS session renegotiation requests that are |
| 804 | initiated by <code>mod_tls</code>, via the |
| 805 | <a href="#TLSRenegotiate"><code>TLSRenegotiate</code></a> directive, are |
| 806 | still handled (depending on the OpenSSL version). |
| 807 | </li> |
| 808 | |
| 809 | <li><code>AllowDotLogin</code><br> |
| 810 | <p> |
| 811 | By default, <code>mod_tls</code> still requires that a user supply a |
| 812 | password for authentication, even if a valid client certificate is |
| 813 | presented. If this option is enabled, <code>mod_tls</code> will check |
| 814 | in the user's home directory for a <code>.tlslogin</code> file, which |
| 815 | should contain one or more PEM-encoded certificates. If the certificate |
| 816 | presented by the client, if any, matches a certificate in this |
| 817 | <code>.tlslogin</code> file, the user will be considered authenticated |
| 818 | and the server will not prompt for a password. If the user's |
| 819 | <code>.tlslogin</code> does not exist, or does not contain the client's |
| 820 | certificate, then the server will fallback to requesting a password for |
| 821 | authentication. |
| 822 | |
| 823 | <p> |
| 824 | <li><code>AllowPerUser</code><br> |
| 825 | <p> |
| 826 | This option affects how <code>mod_tls</code> evaluates any |
| 827 | <code>TLSRequired</code> directives. Usually <code>mod_tls</code> |
| 828 | will reject any FTP commands, when <code>TLSRequired on</code> or |
| 829 | <code>TLSRequired ctrl</code> is in effect, if the client has not |
| 830 | successfully negotiated a SSL/TLS handshake. The FTPS specification |
| 831 | requires that the SSL/TLS handshake occur, via the AUTH FTP command, |
| 832 | <i>before</i> the USER and PASS commands. This means that |
| 833 | <code>mod_tls</code> does not know the identity of the connecting client |
| 834 | when enforcing <code>TLSRequired</code>. If this <code>AllowPerUser</code> |
| 835 | is used, <code>mod_tls</code> will wait until after the <code>PASS</code> |
| 836 | command has been processed to enforce any <code>TLSRequired</code> |
| 837 | settings. |
| 838 | |
| 839 | <p> |
| 840 | <b>Important</b>: if <code>AllowPerUser</code> is used, even if |
| 841 | <code>TLSRequired on</code> or <code>TLSRequired ctrl</code> are in |
| 842 | effect, it will be possible for the connecting client to send |
| 843 | usernames and password <i>unprotected</i> before <code>mod_tls</code> |
| 844 | rejects the connection; those credentials could be intercepted and/or |
| 845 | manipulated before they reach the server. This results in a weaker |
| 846 | security policy enforcement; please consider carefully if this tradeoff is |
| 847 | acceptable for your site. |
| 848 | |
| 849 | <p> |
| 850 | However, <code>TLSRequired auth</code> and |
| 851 | <code>TLSRequired auth+data</code> configurations will override the |
| 852 | <code>AllowPerUser</code> option. |
| 853 | |
| 854 | <p> |
| 855 | <li><code>AllowWeakDH</code><br> |
| 856 | <p> |
| 857 | The <code>mod_tls</code> will not use Diffie-Hellman groups of less |
| 858 | than 1024 bits, due to <a href="https://www.weakdh.org">weaknesses</a> |
| 859 | that can downgrade the security of an SSL/TLS session. If for any reason |
| 860 | your FTPS clients <b>require</b> smaller Diffie-Hellman groups, then |
| 861 | use this option. |
| 862 | |
| 863 | <p> |
| 864 | <b>Note</b> that this option first appeared in |
| 865 | <code>proftpd-1.3.6rc1</code>. |
| 866 | </li> |
| 867 | |
| 868 | <p> |
| 869 | <li><code>AllowWeakSecurity</code> |
| 870 | <p> |
| 871 | Sets the cryptographic security level to "zero", meaning that any/all |
| 872 | ciphers and key sizes are permitted. This option allows for operations |
| 873 | with <i>e.g.</i> CAs with weak messages digests, but is |
| 874 | <b>not recommended</b>. Use only when necessary. |
| 875 | |
| 876 | <p> |
| 877 | <b>Note</b> that this option first appeared in |
| 878 | <code>proftpd-1.3.8rc1</code>. |
| 879 | </li> |
| 880 | |
| 881 | <p> |
| 882 | <li><code>CommonNameRequired</code><br> |
| 883 | <p> |
| 884 | This option will cause <code>mod_tls</code> to perform checks on a client's |
| 885 | certificate once the SSL handshake has been completed: the client's |
| 886 | certificate will be searched for the <code>CommonName</code> (CN) X509v3 |
| 887 | value. Unless a <code>CommonName</code> value is present, and the |
| 888 | value matches the DNS name to which the client's IP address resolves, |
| 889 | the SSL session is closed. This check is only performed during |
| 890 | SSL handshakes on the control channel. Note that if |
| 891 | <code>UseReverseDNS</code> is <em>off</em>, this option is automatically |
| 892 | disabled. |
| 893 | |
| 894 | <p> |
| 895 | <li><code>EnableDiags</code><br> |
| 896 | Sets callbacks in the OpenSSL library such that <b>a lot</b> of |
| 897 | SSL/TLS protocol information is logged to the |
| 898 | <a href="#TLSLog"><code>TLSLog</code></a> file. This option is very |
| 899 | useful when debugging strange interactions with FTPS clients. |
| 900 | |
| 901 | <p> |
| 902 | <li><code>ExportCertData</code><br> |
| 903 | <p> |
| 904 | Sets the following environment variables, if applicable. Note that |
| 905 | doing so increases the memory size of the process quite a bit: |
| 906 | <table border=1 summary="TLS Environment Variables"> |
| 907 | <tr> |
| 908 | <td><code>TLS_SERVER_CERT</code></td> |
| 909 | <td>Server certificate, PEM-encoded</td> |
| 910 | </tr> |
| 911 | |
| 912 | <tr> |
| 913 | <td><code>TLS_CLIENT_CERT</code></td> |
| 914 | <td>Client certificate, PEM-encoded</td> |
| 915 | </tr> |
| 916 | |
| 917 | <tr> |
| 918 | <td><code>TLS_CLIENT_CERT_CHAIN<i>n</i></code></td> |
| 919 | <td>PEM-encoded certificates in client certificate chain</td> |
| 920 | </tr> |
| 921 | </table> |
| 922 | |
| 923 | <p> |
| 924 | <li><code>IgnoreSNI</code><br> |
| 925 | <p> |
| 926 | If the TLS client use the <a href="https://en.wikipedia.org/wiki/Server_Name_Indication">SNI</a> (Server Name Indication) as part of the TLS handshake, |
| 927 | then <code>mod_tls</code> will attempt to use a name-based |
| 928 | <code><VirtualHost></code> matching that name, if found. Use this |
| 929 | option to disable this behavior for any reason. |
| 930 | |
| 931 | <p> |
| 932 | <b>Note</b> that this option first appeared in |
| 933 | <code>proftpd-1.3.7rc3</code>. |
| 934 | </li> |
| 935 | |
| 936 | <p> |
| 937 | <li><code>NoAutoECDH</code><br> |
| 938 | <p> |
| 939 | If OpenSSL-1.0.2 or later is used, then <code>mod_tls</code> will |
| 940 | attempt to automatically negotiate the best EC curve to use, when needed. |
| 941 | Use this option to disable that automatic behavior for any reason. |
| 942 | |
| 943 | <p> |
| 944 | <b>Note</b> that this option first appeared in |
| 945 | <code>proftpd-1.3.6rc1</code>. |
| 946 | </li> |
| 947 | |
| 948 | <p> |
| 949 | <li><code>NoEmptyFragments</code><br> |
| 950 | <p> |
| 951 | In order to prevent certain attacks (<i>e.g.</i> the so-called |
| 952 | <a href="http://www.kb.cert.org/vuls/id/864643">"BEAST" |
| 953 | attack</a>), the <code>mod_tls</code> module was changed to use OpenSSL's |
| 954 | builtin countermeasure of inserting <a href="http://www.openssl.org/~bodo/tls-cbc.txt">empty fragments</a>. However, some browsers/clients may not handle |
| 955 | such empty fragments well. Use this <code>NoEmptyFragments</code> |
| 956 | TLSOption in order to interoperate with such clients, with risk of losing |
| 957 | the protective countermeasure. |
| 958 | |
| 959 | <p> |
| 960 | Note that this protective countermeasure only applies to SSLv3 and TLSv1 |
| 961 | sessions; it does not affect TLSv1.1 or TLSv1.2 sessions. |
| 962 | |
| 963 | <p> |
| 964 | Added in ProFTPD 1.3.4rc4. |
| 965 | |
| 966 | <p> |
| 967 | <li><code>NoSessionReuseRequired</code><br> |
| 968 | <p> |
| 969 | As of ProFTPD 1.3.3rc1, <code>mod_tls</code> only accepts SSL/TLS data |
| 970 | connections that reuse the SSL session of the control connection, as a |
| 971 | security measure. Unfortunately, there are some clients (<i>e.g.</i> |
| 972 | curl) which do not reuse SSL sessions. |
| 973 | |
| 974 | <p> |
| 975 | To relax the requirement that the SSL session from the control connection |
| 976 | be reused for data connections, use the following in the proftpd.conf: |
| 977 | <pre> |
| 978 | <IfModule mod_tls.c> |
| 979 | ... |
| 980 | TLSOptions NoSessionReuseRequired |
| 981 | ... |
| 982 | </IfModule> |
| 983 | </pre> |
| 984 | |
| 985 | <p> |
| 986 | <li><code>StdEnvVars</code><br> |
| 987 | <p> |
| 988 | Sets the following environment variables, if applicable. These environment |
| 989 | variables are then available for use, such as in <code>LogFormat</code>s. |
| 990 | Note that doing so may increase the memory size of the process quite a bit: |
| 991 | <table border=1 summary="Standard Environment Variables"> |
| 992 | <tr> |
| 993 | <td><code>FTPS</code></td> |
| 994 | <td>Present if FTP over SSL/TLS is being used</td> |
| 995 | </tr> |
| 996 | |
| 997 | <tr> |
| 998 | <td><code>TLS_PROTOCOL</code></td> |
| 999 | <td>SSL protocol version (<i>e.g.</i> SSLv3, TLSv1)</td> |
| 1000 | </tr> |
| 1001 | |
| 1002 | <tr> |
| 1003 | <td><code>TLS_SESSION_ID</code></td> |
| 1004 | <td>Hex-encoded SSL session ID</td> |
| 1005 | </tr> |
| 1006 | |
| 1007 | <tr> |
| 1008 | <td><code>TLS_CIPHER</code></td> |
| 1009 | <td>Cipher specification name</td> |
| 1010 | </tr> |
| 1011 | |
| 1012 | <tr> |
| 1013 | <td><code>TLS_CIPHER_EXPORT</code></td> |
| 1014 | <td>Present if cipher is an export cipher</td> |
| 1015 | </tr> |
| 1016 | |
| 1017 | <tr> |
| 1018 | <td><code>TLS_CIPHER_KEYSIZE_POSSIBLE</code></td> |
| 1019 | <td>Number of cipher bits possible</td> |
| 1020 | </tr> |
| 1021 | |
| 1022 | <tr> |
| 1023 | <td><code>TLS_CIPHER_KEYSIZE_USED</code></td> |
| 1024 | <td>Number of cipher bits used</td> |
| 1025 | </tr> |
| 1026 | |
| 1027 | <tr> |
| 1028 | <td><code>TLS_LIBRARY_VERSION</code></td> |
| 1029 | <td>OpenSSL version</td> |
| 1030 | </tr> |
| 1031 | |
| 1032 | <tr> |
| 1033 | <td><code>TLS_CLIENT_M_VERSION</code></td> |
| 1034 | <td>Client certificate version</td> |
| 1035 | </tr> |
| 1036 | |
| 1037 | <tr> |
| 1038 | <td><code>TLS_CLIENT_M_SERIAL</code></td> |
| 1039 | <td>Client certificate serial number</td> |
| 1040 | </tr> |
| 1041 | |
| 1042 | <tr> |
| 1043 | <td><code>TLS_CLIENT_S_DN</code></td> |
| 1044 | <td>Subject DN of client certificate</td> |
| 1045 | </tr> |
| 1046 | |
| 1047 | <tr> |
| 1048 | <td><code>TLS_CLIENT_S_DN_</code><i>x509</i></td> |
| 1049 | <td>Component of client certificate's Subject DN, where <i>x509</i> is |
| 1050 | a component of a X509 DN:<br> |
| 1051 | C,CN,D,I,G,L,O,OU,S,ST,T,UID,Email</td> |
| 1052 | </tr> |
| 1053 | |
| 1054 | <tr> |
| 1055 | <td><code>TLS_CLIENT_I_DN</code></td> |
| 1056 | <td>Issuer DN of client certificate</td> |
| 1057 | </tr> |
| 1058 | |
| 1059 | <tr> |
| 1060 | <td><code>TLS_CLIENT_I_DN_</code><i>x509</i></td> |
| 1061 | <td>Component of client certificate's Issuer DN, where <i>x509</i> is |
| 1062 | a component of a X509 DN:<br> |
| 1063 | C,CN,D,I,G,L,O,OU,S,ST,T,UID,Email</td> |
| 1064 | </tr> |
| 1065 | |
| 1066 | <tr> |
| 1067 | <td><code>TLS_CLIENT_V_START</code></td> |
| 1068 | <td>Start time of client certificate validity</td> |
| 1069 | </tr> |
| 1070 | |
| 1071 | <tr> |
| 1072 | <td><code>TLS_CLIENT_V_END</code></td> |
| 1073 | <td>End time of client certificate validity</td> |
| 1074 | </tr> |
| 1075 | |
| 1076 | <tr> |
| 1077 | <td><code>TLS_CLIENT_A_SIG</code></td> |
| 1078 | <td>Client certificate's signature algorithm</td> |
| 1079 | </tr> |
| 1080 | |
| 1081 | <tr> |
| 1082 | <td><code>TLS_CLIENT_A_KEY</code></td> |
| 1083 | <td>Client certificate's public key algorithm</td> |
| 1084 | </tr> |
| 1085 | |
| 1086 | <tr> |
| 1087 | <td><code>TLS_CLIENT_CERT</code> |
| 1088 | <td>Client certificate, PEM-encoded</td> |
| 1089 | </tr> |
| 1090 | |
| 1091 | <tr> |
| 1092 | <td><code>TLS_CLIENT_CERT_CHAIN<i>n</i></code></td> |
| 1093 | <td>PEM-encoded certificates in client certificate chain</td> |
| 1094 | </tr> |
| 1095 | |
| 1096 | <tr> |
| 1097 | <td><code>TLS_SERVER_M_VERSION</code></td> |
| 1098 | <td>Server certificate version</td> |
| 1099 | </tr> |
| 1100 | |
| 1101 | <tr> |
| 1102 | <td><code>TLS_SERVER_M_SERIAL</code></td> |
| 1103 | <td>Server certificate serial number</td> |
| 1104 | </tr> |
| 1105 | |
| 1106 | <tr> |
| 1107 | <td><code>TLS_SERVER_NAME</code></td> |
| 1108 | <td>Server name requested via Server Name Indication (SNI), if present</td> |
| 1109 | </tr> |
| 1110 | |
| 1111 | <tr> |
| 1112 | <td><code>TLS_SERVER_S_DN</code></td> |
| 1113 | <td>Subject DN of server certificate</td> |
| 1114 | </tr> |
| 1115 | |
| 1116 | <tr> |
| 1117 | <td><code>TLS_SERVER_S_DN_</code><i>x509</i></td> |
| 1118 | <td>Component of server certificate's Subject DN, where <i>x509</i> is |
| 1119 | a component of a X509 DN:<br> |
| 1120 | C,CN,D,I,G,L,O,OU,S,ST,T,UID,Email</td> |
| 1121 | </tr> |
| 1122 | |
| 1123 | <tr> |
| 1124 | <td><code>TLS_SERVER_I_DN</code></td> |
| 1125 | <td>Issuer DN of server certificate</td> |
| 1126 | </tr> |
| 1127 | |
| 1128 | <tr> |
| 1129 | <td><code>TLS_SERVER_I_DN_</code><i>x509</i></td> |
| 1130 | <td>Component of server certificate's Issuer DN, where <i>x509</i> is |
| 1131 | a component of a X509 DN:<br> |
| 1132 | C,CN,D,I,G,L,O,OU,S,ST,T,UID,Email</td> |
| 1133 | </tr> |
| 1134 | |
| 1135 | <tr> |
| 1136 | <td><code>TLS_SERVER_V_START</code></td> |
| 1137 | <td>Start time of server certificate validity</td> |
| 1138 | </tr> |
| 1139 | |
| 1140 | <tr> |
| 1141 | <td><code>TLS_SERVER_V_END</code></td> |
| 1142 | <td>End time of server certificate validity</td> |
| 1143 | </tr> |
| 1144 | |
| 1145 | <tr> |
| 1146 | <td><code>TLS_SERVER_A_SIG</code></td> |
| 1147 | <td>Server certificate's signature algorithm</td> |
| 1148 | </tr> |
| 1149 | |
| 1150 | <tr> |
| 1151 | <td><code>TLS_SERVER_A_KEY</code></td> |
| 1152 | <td>Server certificate's public key algorithm</td> |
| 1153 | </tr> |
| 1154 | |
| 1155 | <tr> |
| 1156 | <td><code>TLS_SERVER_CERT</code></td> |
| 1157 | <td>Server certificate, PEM-encoded</td> |
| 1158 | </tr> |
| 1159 | </table> |
| 1160 | |
| 1161 | <p> |
| 1162 | <li><code>UseImplicitSSL</code><br> |
| 1163 | <p> |
| 1164 | This option will cause the <code>mod_tls</code> module to handle <b>all</b> |
| 1165 | connections as if they are SSL connections implicitly; the client does |
| 1166 | <i>not</i> need to send the <code>AUTH TLS</code> FTP command. This can |
| 1167 | cause issues for FTPS clients which are expecting explicit FTPS, not |
| 1168 | implicit FTPS. |
| 1169 | |
| 1170 | <p> |
| 1171 | Thus if the <code>UseImplicitSSL</code> option is used, you will want to |
| 1172 | have a separate <code><VirtualHost></code> section with |
| 1173 | a different port number just for those clients which require/expect |
| 1174 | implicit FTPS. For example: |
| 1175 | <pre> |
| 1176 | <IfModule mod_tls.c> |
| 1177 | <VirtualHost a.b.c.d> |
| 1178 | TLSEngine on |
| 1179 | TLSOptions UseImplicitSSL |
| 1180 | |
| 1181 | # The "standard" implicit FTPS port is 990 |
| 1182 | Port 990 |
| 1183 | ... |
| 1184 | </VirtualHost> |
| 1185 | </IfModule> |
| 1186 | </pre> |
| 1187 | |
| 1188 | <p> |
| 1189 | <li><code>dNSNameRequired</code><br> |
| 1190 | <p> |
| 1191 | This option will cause <code>mod_tls</code> to perform checks on a client's |
| 1192 | certificate once the SSL handshake has been completed: the client's |
| 1193 | certificate will be searched for the <code>subjectAltName</code> X509v3 |
| 1194 | extension, and, in that extension, the <code>dNSName</code> value will |
| 1195 | be looked up. Unless a <code>dNSName</code> value is present, and the |
| 1196 | value matches the DNS name to which the client's IP address resolves, |
| 1197 | the SSL session is closed. This check is only performed during |
| 1198 | SSL handshakes on the control channel. Note that if |
| 1199 | <code>UseReverseDNS</code> is <em>off</em>, this option is automatically |
| 1200 | disabled. |
| 1201 | |
| 1202 | <p> |
| 1203 | <li><code>iPAddressRequired</code><br> |
| 1204 | <p> |
| 1205 | This option will cause <code>mod_tls</code> to perform checks on a client's |
| 1206 | certificate once the SSL handshake has been completed: the client's |
| 1207 | certificate will be searched for the <code>subjectAltName</code> X509v3 |
| 1208 | extension, and, in that extension, the <code>iPAddress</code> value will |
| 1209 | be looked up. Unless an <code>iPAddress</code> value is present, and the |
| 1210 | value matches the IP address of the client, the SSL session is closed. |
| 1211 | This check is only performed during SSL handshakes on the control channel. |
| 1212 | </ul> |
| 1213 | |
| 1214 | <p> |
| 1215 | <hr> |
| 1216 | <h3><a name="TLSPKCS12File">TLSPKCS12File</a></h3> |
| 1217 | <strong>Syntax:</strong> TLSPKCS12File <em>file</em><br> |
| 1218 | <strong>Default:</strong> None<br> |
| 1219 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 1220 | <strong>Module:</strong> mod_tls<br> |
| 1221 | <strong>Compatibility:</strong> 1.3.3rc1 and later |
| 1222 | |
| 1223 | <p> |
| 1224 | The <code>TLSPKCS12ile</code> directive points to the PKCS#12 file containing |
| 1225 | the certificate file and its private key for the server. |
| 1226 | |
| 1227 | <p> |
| 1228 | If the PKCS#12 file is protected with a passphrase, the administrator will |
| 1229 | be prompted for the passphrase when the daemon starts up, and when the daemon |
| 1230 | is restarted. Alternatively, the <code>TLSPassPhraseProvider</code> |
| 1231 | directive can be used to supply a source for that passphrase. |
| 1232 | |
| 1233 | <p> |
| 1234 | Example: |
| 1235 | <pre> |
| 1236 | TLSPKCS12File /etc/ftpd/server-cert.p12 |
| 1237 | </pre> |
| 1238 | |
| 1239 | <p> |
| 1240 | <hr> |
| 1241 | <h3><a name="TLSPassPhraseProvider">TLSPassPhraseProvider</a></h3> |
| 1242 | <strong>Syntax:</strong> TLSPassPhraseProvider <em>path</em><br> |
| 1243 | <strong>Default:</strong> None<br> |
| 1244 | <strong>Context:</strong> server config<br> |
| 1245 | <strong>Module:</strong> mod_tls<br> |
| 1246 | <strong>Compatibility:</strong> 1.3.1rc1 and later |
| 1247 | |
| 1248 | <p> |
| 1249 | The <code>TLSPassPhraseProvider</code> directive is used to specify an |
| 1250 | external program which will be called, when <code>mod_tls</code> starts up, |
| 1251 | for each encrypted certificate key file. The program will be invoked with |
| 1252 | two command-line arguments, passed on <code>stdin</code> to the program: |
| 1253 | <pre> |
| 1254 | <em>servername</em>:<em>portnumber</em> "RSA"|"DSA" |
| 1255 | </pre> |
| 1256 | where <code><em>servername</em>:<em>portnumber</em></code> indicates the |
| 1257 | server using that encrypted certificate key, and <code>"RSA"</code> |
| 1258 | or <code>"DSA"</code> indicates the private key algorithm used |
| 1259 | for that key. The program then must print the corresponding passphrase |
| 1260 | for the key to <code>stdout</code>. |
| 1261 | |
| 1262 | <p> |
| 1263 | The intent is that this external program can perform any security checks |
| 1264 | necessary, to make sure that the system is not compromised by an attacker, |
| 1265 | and only when these checks pass successfully will the passphrase be provided. |
| 1266 | These security checks, and the way the passphrase is determined, can be as |
| 1267 | complex as you like. |
| 1268 | |
| 1269 | <p> |
| 1270 | Example: |
| 1271 | <pre> |
| 1272 | TLSPassPhraseProvider /etc/ftpd/tls/get-passphrase |
| 1273 | </pre> |
| 1274 | |
| 1275 | <p> |
| 1276 | <hr> |
| 1277 | <h3><a name="TLSPreSharedKey">TLSPreSharedKey</a></h3> |
| 1278 | <strong>Syntax:</strong> TLSPreSharedKey <em>identity</em> <em>key-info</em><br> |
| 1279 | <strong>Default:</strong> None<br> |
| 1280 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 1281 | <strong>Module:</strong> mod_tls<br> |
| 1282 | <strong>Compatibility:</strong> 1.3.6rc1 and later |
| 1283 | |
| 1284 | <p> |
| 1285 | The <code>TLSPreSharedKey</code> directive is used to configure a <em>pre-shared |
| 1286 | key</em> (PSK), for use in |
| 1287 | <a href="http://en.wikipedia.org/wiki/TLS-PSK">TLS-PSK</a> ciphersuites. Each |
| 1288 | PSK has an <em>identity</em> (a string/name used by clients to request the use |
| 1289 | of that PSK), and the actual key data. The key data may be encoded in different |
| 1290 | ways; the <code>TLSPreSharedKey</code> directive requires that the data be |
| 1291 | hex-encoded, as indicated in the <em>key-info</em> parameter. |
| 1292 | |
| 1293 | <p> |
| 1294 | The <em>key-info</em> parameter is comprised of: the type of encoding used for |
| 1295 | the key data, and the full path to the key file. Only "hex" encoding is |
| 1296 | supported right now. Thus an example <code>TLSPreSharedKey</code> directive |
| 1297 | would be: |
| 1298 | <pre> |
| 1299 | TLSPreSharedKey psk-name hex:/path/to/psk.key |
| 1300 | </pre> |
| 1301 | The configured file <b>cannot be world-readable or world-writable</b>; the |
| 1302 | <code>mod_tls</code> module will skip/ignore such insecure permissions. |
| 1303 | |
| 1304 | <p> |
| 1305 | To generate this shared key (which is just a randomly generated bit of data), |
| 1306 | you can use: |
| 1307 | <pre> |
| 1308 | $ openssl rand 80 -out /path/to/identity.key -hex |
| 1309 | </pre> |
| 1310 | Note that <code>TLSPreSharedKey</code> requires at least 20 bytes of key data. |
| 1311 | Have generated the random key data, tell <code>mod_tls</code> to use it via: |
| 1312 | <pre> |
| 1313 | TLSPreSharedKey identity hex:/path/to/identity.key |
| 1314 | </pre> |
| 1315 | |
| 1316 | <p> |
| 1317 | Multiple <code>TLSPreSharedKey</code> directives can be used to configure |
| 1318 | different PSKs for different identity names. |
| 1319 | |
| 1320 | <p> |
| 1321 | <hr> |
| 1322 | <h3><a name="TLSProtocol">TLSProtocol</a></h3> |
| 1323 | <strong>Syntax:</strong> TLSProtocol <em>protocol1</em> ... <em>protocolN</em><br> |
| 1324 | <strong>Default:</strong> TLSv1<br> |
| 1325 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 1326 | <strong>Module:</strong> mod_tls<br> |
| 1327 | <strong>Compatibility:</strong> 1.2.7rc1 and later |
| 1328 | |
| 1329 | <p> |
| 1330 | The <code>TLSProtocol</code> directive is used to configure the SSL/TLS |
| 1331 | protocol versions that <code>mod_tls</code> should use when establishing |
| 1332 | SSL/TLS sessions. Clients can then only connect using the configured |
| 1333 | protocol. |
| 1334 | |
| 1335 | <p> |
| 1336 | Since the protocol version used by <code>mod_tls</code> is set only once, |
| 1337 | when the daemon starts, the <code>TLSProtocol</code> directive is only allowed |
| 1338 | in the "server config" context. |
| 1339 | |
| 1340 | <p> |
| 1341 | The allowed protocols are: |
| 1342 | <p> |
| 1343 | <table summary="TLS Protocol Versions"> |
| 1344 | <tr> |
| 1345 | <td><code>SSLv3</code></td> |
| 1346 | <td>Allow only SSLv3</td> |
| 1347 | </tr> |
| 1348 | |
| 1349 | <tr> |
| 1350 | <td><code>TLSv1</code></td> |
| 1351 | <td>Allow only TLSv1</td> |
| 1352 | </tr> |
| 1353 | |
| 1354 | <tr> |
| 1355 | <td><code>TLSv1.1</code></td> |
| 1356 | <td>Allow only TLSv1.1</td> |
| 1357 | </tr> |
| 1358 | |
| 1359 | <tr> |
| 1360 | <td><code>TLSv1.2</code></td> |
| 1361 | <td>Allow only TLSv1.2</td> |
| 1362 | </tr> |
| 1363 | |
| 1364 | <tr> |
| 1365 | <td><code>TLSv1.3</code></td> |
| 1366 | <td>Allow only TLSv1.3</td> |
| 1367 | </tr> |
| 1368 | |
| 1369 | </table> |
| 1370 | To support both SSLv3 and TLSv1, simply list both parameters for the |
| 1371 | <code>TLSProtocol</code> directive, <i>e.g.</i>: |
| 1372 | <pre> |
| 1373 | TLSProtocol SSLv3 TLSv1 |
| 1374 | </pre> |
| 1375 | |
| 1376 | <p> |
| 1377 | Note that the parameter "SSLv23" is supported as a legacy style for saying |
| 1378 | "all versions". |
| 1379 | |
| 1380 | <p> |
| 1381 | All use of SSLv2 is disabled. SSLv2 <b>should not</b> be used. As of |
| 1382 | <code>proftpd-1.3.6rc1</code>, SSLv3 support has been disabled as well. |
| 1383 | |
| 1384 | <p> |
| 1385 | In <code>proftpd-1.3.6rc2</code> and later, you can use the |
| 1386 | <code>TLSProtocol</code> directive in a different manner, to <em>add</em> |
| 1387 | or <em>subtract</em> protocol support. For example, to enable all protocols |
| 1388 | <b>except</b> SSLv3, you can use: |
| 1389 | <pre> |
| 1390 | TLSProtocol ALL -SSLv3 |
| 1391 | </pre> |
| 1392 | Using the directive in this manner requires that "ALL" be the <b>first</b> |
| 1393 | parameter, <i>and</i> that all protocols have either a <code>+</code> |
| 1394 | (<em>add</em>) or <code>-</code> (<em>subtract</em>) prefix. "ALL" will |
| 1395 | always be expanded to all of the supported SSL/TLS protocols known by |
| 1396 | <code>mod_tls</code> and supported by <code>OpenSSL</code>. |
| 1397 | |
| 1398 | <p> |
| 1399 | <hr> |
| 1400 | <h3><a name="TLSRandomSeed">TLSRandomSeed</a></h3> |
| 1401 | <strong>Syntax:</strong> TLSRandomSeed <em>seed</em><br> |
| 1402 | <strong>Default:</strong> <i>openssl-dir</i><code>/.rnd</code><br> |
| 1403 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 1404 | <strong>Module:</strong> mod_tls<br> |
| 1405 | <strong>Compatibility:</strong> 1.2.7rc1 and later |
| 1406 | |
| 1407 | <p> |
| 1408 | The <code>TLSRandomSeed</code> directive configures the file that |
| 1409 | <code>mod_tls</code> will use for seeding the PRNG. <em>seed</em> must be an |
| 1410 | absolute path. |
| 1411 | |
| 1412 | <p> |
| 1413 | When the daemon shuts down, any random data left will be written out to the |
| 1414 | random seed file, so that that data may be used for seeding when the daemon |
| 1415 | is started again. |
| 1416 | |
| 1417 | <p> |
| 1418 | Example: |
| 1419 | <pre> |
| 1420 | TLSRandomSeed /etc/ftpd/server.rnd |
| 1421 | </pre> |
| 1422 | |
| 1423 | <p> |
| 1424 | Note that the <code>TLSRandomSeed</code> directive is <b>not</b> used to |
| 1425 | seed the entropy required by the OpenSSL library; that configuration |
| 1426 | is OpenSSL-specific. Instead, the <code>TLSRandomSeed</code> file can |
| 1427 | be thought of a cache file for the unused entropy, to be used to help |
| 1428 | speed up entropy gathering when the daemon starts up again. |
| 1429 | |
| 1430 | <p> |
| 1431 | <hr> |
| 1432 | <h3><a name="TLSRenegotiate">TLSRenegotiate</a></h3> |
| 1433 | <strong>Syntax:</strong> TLSRenegotiate <em>["ctrl" secs] ["data" Kbytes] ["timeout" secs]|["required" on|off]|"none"</em><br> |
| 1434 | <strong>Default:</strong> ctrl 14400 data 25165824 required true <i>(for OpenSSL 0.9.7 or greater)</i><br> |
| 1435 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 1436 | <strong>Module:</strong> mod_tls<br> |
| 1437 | <strong>Compatibility:</strong> 1.2.7rc1 and later |
| 1438 | |
| 1439 | <p> |
| 1440 | The <code>TLSRenegotiate</code> directive is used to configure when SSL/TLS |
| 1441 | renegotiations are to occur. Renegotiations, and thus this directive, are |
| 1442 | only supported by <code>mod_tls</code> if the version of OpenSSL installed |
| 1443 | is 0.9.7 or greater. |
| 1444 | |
| 1445 | <p> |
| 1446 | If supported, renegotiations will occur on control channels that have been |
| 1447 | established for four hours by default, and on data channels that have |
| 1448 | transferred over one gigabyte of data by default. When renegotiations are |
| 1449 | requested, the client is given a timeout of 30 seconds, by default, to perform |
| 1450 | the renegotiation. To change the default control channel renegotiation |
| 1451 | timeout, use <em>ctrl</em> followed by a number, greater than zero, in seconds. |
| 1452 | Use <em>data</em> followed by a number, greater than zero, of kilobytes to |
| 1453 | change the default data channel renegotiation threshold. The <em>timeout</em> |
| 1454 | parameter, followed by a positive number of seconds, is used to change the |
| 1455 | length of time given to a client to complete a requested renegotiation, after |
| 1456 | which the SSL session will be shutdown. By default, <code>mod_tls</code> |
| 1457 | will <b>require</b> that the client comply with the requested renegotiation |
| 1458 | within the <code>TLSRenegotiate</code> timeout. If, however, the client is |
| 1459 | unwilling or unable to do so, and the daemon needs to support these clients, |
| 1460 | set <em>required</em> to <i>off</i>. Doing so will cause renegotiations to |
| 1461 | be requested, but not required. |
| 1462 | |
| 1463 | <p> |
| 1464 | By default, <code>mod_tls</code> will perform renegotiations if supported, on |
| 1465 | the control channel after 4 hours, and on the data channel after one gigabyte |
| 1466 | of transferred data. The default timeout for a renegotiation is 30 seconds. |
| 1467 | |
| 1468 | <p> |
| 1469 | In OpenSSL 0.9.8l and later, SSL/TLS session renegotiations are automatically |
| 1470 | disabled. In order to use renegotiations as configured by the |
| 1471 | <code>TLSRenegotiate</code> directive, you must <i>also</i> explicitly allow |
| 1472 | them via: |
| 1473 | <pre> |
| 1474 | # Allow renegotiations (not recommended; see CVE-2009-3555, CVE-2011-1473) |
| 1475 | TLSOptions AllowClientRenegotiations |
| 1476 | </pre> |
| 1477 | |
| 1478 | <p> |
| 1479 | The TLSv1.3 protocol does not support renegotiations, but it <i>does</i> support |
| 1480 | updating the session keys, which is the primary goal/function of the |
| 1481 | <code>TLSRenegotiate</code> directive. Thus using OpenSSL 1.1.1 and later, |
| 1482 | key updates will be requested for control and data sessions for TLSv1.3 |
| 1483 | sessions. |
| 1484 | |
| 1485 | <p> |
| 1486 | Use <em>none</em> to explicitly disable all renegotiation requirements. |
| 1487 | |
| 1488 | <p> |
| 1489 | Examples: |
| 1490 | <pre> |
| 1491 | # Allow renegotiations |
| 1492 | TLSOptions AllowClientRenegotiations |
| 1493 | |
| 1494 | # Change renegotiations to occur on control channels after 1 hour |
| 1495 | TLSRenegotiate ctrl 3600 |
| 1496 | |
| 1497 | # Change renegotiations to occur on data channels after 500 MB |
| 1498 | TLSRenegotiate data 512000 |
| 1499 | |
| 1500 | # Change renegotiations so that they are not required, only requested |
| 1501 | TLSRenegotiate required off |
| 1502 | |
| 1503 | # Change only the timeout for renegotiations to be 5 minutes |
| 1504 | TLSRenegotiate timeout 300 |
| 1505 | |
| 1506 | # Change all of the above renegotiation thresholds using one directive |
| 1507 | TLSRenegotiate ctrl 3600 data 512000 required off timeout 300 |
| 1508 | |
| 1509 | # To disable renegotiations entirely |
| 1510 | TLSRenegotiate none |
| 1511 | </pre> |
| 1512 | |
| 1513 | <p> |
| 1514 | <b>Note</b> that in ProFTPD 1.3.8rc2 and later, the <em>default</em> behavior |
| 1515 | of <code>TLSRenegotiate</code> changed, such that <code>mod_tls</code> will |
| 1516 | not request SSL/TLS renegotiations <em>at all</em> for control <i>or</i> |
| 1517 | data connections. If renegotiations are <i>explicitly</i> configured via |
| 1518 | <code>TLSRenegotiate</code>, they will be used. |
| 1519 | |
| 1520 | <p> |
| 1521 | <hr> |
| 1522 | <h3><a name="TLSRequired">TLSRequired</a></h3> |
| 1523 | <strong>Syntax:</strong> TLSRequired <em>on|off|ctrl|[!]data|auth|auth+[!]data</em><br> |
| 1524 | <strong>Default:</strong> off<br> |
| 1525 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code>, <code><Anonymous></code><br> |
| 1526 | <strong>Module:</strong> mod_tls<br> |
| 1527 | <strong>Compatibility:</strong> 1.2.7rc1 and later |
| 1528 | |
| 1529 | <p> |
| 1530 | The <code>TLSRequired</code> directive is used to define a basic security |
| 1531 | policy, one that dictates whether the control channel, or data channel, or |
| 1532 | both, of an FTP session must occur over SSL/TLS. |
| 1533 | |
| 1534 | <p> |
| 1535 | The <em>on</em> parameter enables SSL/TLS requirements on both control and |
| 1536 | data channels; <em>off</em> disables the requirements on both channels. |
| 1537 | Use <em>ctrl</em> and <em>data</em> to require SSL/TLS on either channel |
| 1538 | individually. |
| 1539 | |
| 1540 | <p> |
| 1541 | Example: |
| 1542 | <pre> |
| 1543 | # Require SSL/TLS on the control channel, so that passwords are not sent |
| 1544 | # in the clear. |
| 1545 | TLSRequired ctrl |
| 1546 | |
| 1547 | # Require SSL/TLS on both channels. |
| 1548 | TLSRequired on |
| 1549 | </pre> |
| 1550 | |
| 1551 | The <em>auth</em> parameter requires that SSL/TLS be used on the control |
| 1552 | channel, but only for authentication. To use this setting <i>and</i> |
| 1553 | require SSL/TLS for data transfers, use the <em>auth+data</em> parameter, |
| 1554 | <i>e.g.</i>: |
| 1555 | <pre> |
| 1556 | # Allow the client to use the CCC command to remove SSL/TLS from the |
| 1557 | # control channel, but only after authentication has been performed. |
| 1558 | # Still enforce the policy of using SSL/TLS for data transfers. |
| 1559 | # |
| 1560 | # Note that if we did not need to protect data transfers, we would |
| 1561 | # set 'TLSRequired auth' instead of using 'TLSRequired auth+data'. |
| 1562 | TLSRequired auth+data |
| 1563 | </pre> |
| 1564 | This <em>auth+data</em> parameter allows a very specific security policy: |
| 1565 | authentication via the <code>USER</code>/<code>PASS</code> commands |
| 1566 | <b>must</b> be protected via SSL/TLS, as must the data channel, but after |
| 1567 | authenticating, the client can request that protection be removed from the |
| 1568 | control channel. This policy allows clients to use the <code>CCC</code> |
| 1569 | (<b>C</b>lear <b>C</b>ommand <b>C</b>hannel) command, which in turn enables |
| 1570 | SSL/TLS protected data transfers that are operate better with firewalls that |
| 1571 | monitor the FTP control channel. |
| 1572 | |
| 1573 | <p> |
| 1574 | It is <i>also</i> possible to configure a policy which <i>rejects</i> use |
| 1575 | of SSL/TLS for protecting the data channel. Some sites may wish to use |
| 1576 | such a policy in order to protect the control channels of their clients, but |
| 1577 | to prevent the data transfers from consuming too much CPU. The |
| 1578 | <code>TLSRequired</code> directive can be set such that an FTPS client |
| 1579 | requesting protection of the data channel, using the <code>PROT</code> command, |
| 1580 | will have that command refused. To configure such a policy, use one of |
| 1581 | the following: |
| 1582 | <pre> |
| 1583 | # If the client wishes to protect the control channel, allow it; but reject |
| 1584 | # any attempt to protect the data channel |
| 1585 | TLSRequired !data |
| 1586 | |
| 1587 | # <b>Require</b> protection on the control channel, but reject protection of the |
| 1588 | # data channel |
| 1589 | TLSRequired ctrl+!data |
| 1590 | |
| 1591 | # <b>Require</b> protection on the control channel for <i>authentication</i> (but not |
| 1592 | # after), and reject protection of the data channel |
| 1593 | TLSRequired auth+!data |
| 1594 | </pre> |
| 1595 | |
| 1596 | <p> |
| 1597 | <hr> |
| 1598 | <h3><a name="TLSRSACertificateFile">TLSRSACertificateFile</a></h3> |
| 1599 | <strong>Syntax:</strong> TLSRSACertificateFile <em>file</em><br> |
| 1600 | <strong>Default:</strong> None<br> |
| 1601 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 1602 | <strong>Module:</strong> mod_tls<br> |
| 1603 | <strong>Compatibility:</strong> 1.2.7rc1 and later |
| 1604 | |
| 1605 | <p> |
| 1606 | The <code>TLSRSACertificateFile</code> directive points to the PEM-encoded |
| 1607 | file containing the RSA certificate file for the server and optionally also |
| 1608 | the corresponding RSA private key file. |
| 1609 | |
| 1610 | <p> |
| 1611 | If the contained private key is encrypted, the administrator will be |
| 1612 | prompted for the passphrase when the daemon starts up, and when the daemon |
| 1613 | is restarted. Alternatively, the <code>TLSPassPhraseProvider</code> |
| 1614 | directive can be used to supply a source for that passphrase. |
| 1615 | |
| 1616 | <p> |
| 1617 | Example: |
| 1618 | <pre> |
| 1619 | TLSRSACertificateFile /etc/ftpd/server-rsa-cert.pem |
| 1620 | </pre> |
| 1621 | |
| 1622 | <p> |
| 1623 | <hr> |
| 1624 | <h3><a name="TLSRSACertificateKeyFile">TLSRSACertificateKeyFile</a></h3> |
| 1625 | <strong>Syntax:</strong> TLSRSACertificateKeyFile <em>file</em><br> |
| 1626 | <strong>Default:</strong> None<br> |
| 1627 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 1628 | <strong>Module:</strong> mod_tls<br> |
| 1629 | <strong>Compatibility:</strong> 1.2.7rc1 and later |
| 1630 | |
| 1631 | <p> |
| 1632 | The <code>TLSRSACertificateKeyFile</code> directive points to the PEM-encoded |
| 1633 | private key file for the server. If the private key is not combined with the |
| 1634 | certificate in the <code>TLSRSACertificateFile</code>, use this additional |
| 1635 | directive to point to the file with the standalone private key. When |
| 1636 | <code>TLSRSACertificateFile</code> is used and the file contains both the |
| 1637 | certificate and the private key, this directive need not be used. However, |
| 1638 | this practice is strongly discouraged. Instead we recommend you to separate |
| 1639 | the certificate and the private key. |
| 1640 | |
| 1641 | <p> |
| 1642 | If the contained private key is encrypted, the administrator will be |
| 1643 | prompted for the passphrase when the daemon starts up, and when the daemon |
| 1644 | is restarted. |
| 1645 | |
| 1646 | <p> |
| 1647 | Example: |
| 1648 | <pre> |
| 1649 | TLSRSACertificateKeyFile /etc/ftpd/server-rsa-key.pem |
| 1650 | </pre> |
| 1651 | |
| 1652 | <p> |
| 1653 | <hr> |
| 1654 | <h3><a name="TLSServerCipherPreference">TLSServerCipherPreference</a></h3> |
| 1655 | <strong>Syntax:</strong> TLSServerCipherPreference <em>on|off</em><br> |
| 1656 | <strong>Default:</strong> Depends<br> |
| 1657 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 1658 | <strong>Module:</strong> mod_tls<br> |
| 1659 | <strong>Compatibility:</strong> 1.3.5rc1 and later |
| 1660 | |
| 1661 | <p> |
| 1662 | When choosing a cipher during an SSLv3 or TLSv1 handshake, normally the |
| 1663 | <i>client's</i> ciphersuite preference is used. If the |
| 1664 | <code>TLSServerCipherPreference</code> directive is enabled, then the |
| 1665 | <i>server's</i> ciphersuite preference will be used instead. |
| 1666 | |
| 1667 | <p> |
| 1668 | For example: |
| 1669 | <pre> |
| 1670 | TLSServerCipherPreference on |
| 1671 | </pre> |
| 1672 | |
| 1673 | <p> |
| 1674 | Note that starting with ProFTPD 1.3.7rc1, <code>TLSServerCipherPreference</code> |
| 1675 | is <em>enabled</em> by default. |
| 1676 | |
| 1677 | <p> |
| 1678 | <hr> |
| 1679 | <h3><a name="TLSServerInfoFile">TLSServerInfoFile</a></h3> |
| 1680 | <strong>Syntax:</strong> TLSServerInfoFile <em>file</em><br> |
| 1681 | <strong>Default:</strong> None<br> |
| 1682 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 1683 | <strong>Module:</strong> mod_tls<br> |
| 1684 | <strong>Compatibility:</strong> 1.3.6rc2 and later |
| 1685 | |
| 1686 | <p> |
| 1687 | The <code>TLSServerInfoFile</code> directive uses the configured <em>file</em> |
| 1688 | as custom TLS extensions. See the OpenSSL documentation for the <a href="https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_use_serverinfo_file.html"><code>SSL_CTX_use_serverinfo_file()</code></a> for more information. |
| 1689 | |
| 1690 | <p> |
| 1691 | <hr> |
| 1692 | <h3><a name="TLSSessionCache">TLSSessionCache</a></h3> |
| 1693 | <strong>Syntax:</strong> TLSSessionCache <em>"off"|type:/info [timeout]</em><br> |
| 1694 | <strong>Default:</strong> None<br> |
| 1695 | <strong>Context:</strong> server config<br> |
| 1696 | <strong>Module:</strong> mod_tls<br> |
| 1697 | <strong>Compatibility:</strong> 1.3.3rc1 and later |
| 1698 | |
| 1699 | <p> |
| 1700 | The <code>TLSSessionCache</code> directive configures an external SSL session |
| 1701 | cache, which can be used for storing and sharing SSL sessions across multiple |
| 1702 | processes. An external SSL session cache is an optional facility which speeds |
| 1703 | up parallel FTPS session connections. |
| 1704 | |
| 1705 | <p> |
| 1706 | Modern FTP clients often create multiple simultaneous connections to an FTP |
| 1707 | server, for downloading different chunks of data in parallel. Each FTP |
| 1708 | connection will be handled by a different server process, and each one |
| 1709 | will be required to perform a full SSL/TLS handshake. By using an |
| 1710 | external SSL session cache, a cached SSL session can be "resumed" by the |
| 1711 | client, which avoids the expensive portions of the handshake. FTPS clients |
| 1712 | which cache the SSL session locally can also attempt to resume that cached |
| 1713 | session at a later date; if the server still has that same session cached, |
| 1714 | the FTPS client can again avoid the expensive portions of the handshake and |
| 1715 | resume its previous SSL session. |
| 1716 | |
| 1717 | <p> |
| 1718 | If the <code>TLSSessionCache</code> directive is <i>not</i> used, then |
| 1719 | OpenSSL's default internal SSL session caching will be used. Thus multiple |
| 1720 | SSL sessions to the same server process (<i>e.g.</i> for FTP data transfers) |
| 1721 | will benefit from the speedup, but parallel simultaneous FTP connections from |
| 1722 | the same FTPS client will each need to perform the full SSL/TLS handshake. |
| 1723 | By default, OpenSSL caches SSL sessions for 300 seconds (5 minutes). If |
| 1724 | your FTP sessions last longer than this (<i>e.g.</i> for downloading large |
| 1725 | files), you may need to configure a longer cache lifetime using: |
| 1726 | <pre> |
| 1727 | # Configure OpenSSL's internal caching to be 1800 seconds (30 minutes) |
| 1728 | TLSSessionCache internal: 1800 |
| 1729 | </pre> |
| 1730 | |
| 1731 | <p> |
| 1732 | The <em>type</em> and <em>info</em> parameters all depend on the module |
| 1733 | implementing the external SSL session cache being configured. For example, |
| 1734 | for using a shared memory external SSL session cache, see the |
| 1735 | <a href="mod_tls_shmcache.html"><code>mod_tls_shmcache</code></a> documentation. |
| 1736 | |
| 1737 | <p> |
| 1738 | The optional <em>timeout</em> parameters sets the time-to-live, in seconds, for |
| 1739 | the SSL session datal stored in the external SSL session cache. It can be set |
| 1740 | as low as 15 for testing, but should be set to higher values like 600 in real |
| 1741 | life. The default timeout is 1800 seconds (30 minutes). <b>Note</b> that to |
| 1742 | ensure that the session cache is <em>aggressively</em> pruned of expired |
| 1743 | sessions, <b>each</b> FTP session, upon ending, will flush <b>any</b> expired |
| 1744 | sessions from the session cache. |
| 1745 | |
| 1746 | <p> |
| 1747 | Use of SSL session caching can be disabled entirely by using: |
| 1748 | <pre> |
| 1749 | TLSSessionCache off |
| 1750 | </pre> |
| 1751 | |
| 1752 | <p> |
| 1753 | <hr> |
| 1754 | <h3><a name="TLSSessionTicketKeys">TLSSessionTicketKeys</a></h3> |
| 1755 | <strong>Syntax:</strong> TLSSessionTicketKeys [age <em>secs</em>] [count <em>number</em>]<br> |
| 1756 | <strong>Default:</strong> TLSSessionTicketKeys age 12h count 25<br> |
| 1757 | <strong>Context:</strong> server config</br> |
| 1758 | <strong>Module:</strong> mod_tls<br> |
| 1759 | <strong>Compatibility:</strong> 1.3.6rc2 and later |
| 1760 | |
| 1761 | <p> |
| 1762 | The <code>TLSSessionTicketKeys</code> directive can be used to control how |
| 1763 | often <code>mod_tls</code> generates new session ticket keys (assuming that |
| 1764 | <a href="#TLSSessionTickets"><code>TLSSessionTickets</code></a> is enabled), |
| 1765 | and how many ticket keys will be kept in one time in memory. |
| 1766 | |
| 1767 | <p> |
| 1768 | By default, <code>mod_tls</code> expires a session ticket key after 12 hours; |
| 1769 | this can be changed using the <em>age</em> parameter, to specify a maximum |
| 1770 | age. <b>Note</b> that the <i>minimum</i> key age is 60 seconds. |
| 1771 | |
| 1772 | <p> |
| 1773 | Only a maximum of 25 session ticket keys will be kept in memory by default; |
| 1774 | older/expired keys will be destroyed. This maximum count of keys can |
| 1775 | be changed using the <em>count</em> parameter. <b>Note</b> that there is a |
| 1776 | minimum count (1) of ticket keys; attempting to specify a smaller <em>count</em> |
| 1777 | is a configuration error. |
| 1778 | |
| 1779 | <p> |
| 1780 | <hr> |
| 1781 | <h3><a name="TLSSessionTickets">TLSSessionTickets</a></h3> |
| 1782 | <strong>Syntax:</strong> TLSSessionTickets <em>on|off</em><br> |
| 1783 | <strong>Default:</strong> off<br> |
| 1784 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 1785 | <strong>Module:</strong> mod_tls<br> |
| 1786 | <strong>Compatibility:</strong> 1.3.6rc2 and later |
| 1787 | |
| 1788 | <p> |
| 1789 | The <code>TLSSessionTickets</code> directive enables the use of TLS |
| 1790 | "session tickets" (see <a href="http://www.faqs.org/rfcs/rfc5077.html">RFC 5077</a>), which allow for session resumption, similar to TLS session caching. |
| 1791 | |
| 1792 | <p> |
| 1793 | The <code>mod_tls</code> module does <b>not</b> support configuration/use of |
| 1794 | a static session ticket <em>key</em>, unlike Apache or nginx. Instead, |
| 1795 | <code>mod_tls</code> <i>always</i> randomly generates its own session ticket |
| 1796 | keys. These keys are only kept in memory, and are automatically generated |
| 1797 | on a schedule; older keys are destroyed automatically. |
| 1798 | |
| 1799 | <p> |
| 1800 | When a session is resumed using a session ticket encrypted with an older |
| 1801 | session ticket key (which has not yet expired), the <code>mod_tls</code> will |
| 1802 | honor that session ticket, <i>but</i> will also <b>renew</b> the encryption |
| 1803 | of the session ticket using a newer session ticket key. Session tickets |
| 1804 | encrypted with keys which have expired will not be honored, and a full TLS |
| 1805 | handshake will occur. |
| 1806 | |
| 1807 | <p> |
| 1808 | For control over the key expiration and generation schedule, use the |
| 1809 | <a href="#TLSSessionTicketKeys"><code>TLSSessionTicketKeys</code></a> |
| 1810 | directive. |
| 1811 | |
| 1812 | <p> |
| 1813 | <b>Note</b>: TLSv1.3 sessions <b>require</b> the use of session tickets, |
| 1814 | as the protocol favors stateless tickets <i>versus</i> stateful server-side |
| 1815 | session IDs for session resumption. Thus for TLSv1.3 sessions, the |
| 1816 | <code>TLSSessionTickets</code> directive is <i>ignored</i>, and session |
| 1817 | tickets are supported. |
| 1818 | |
| 1819 | <p> |
| 1820 | <hr> |
| 1821 | <h3><a name="TLSStapling">TLSStapling</a></h3> |
| 1822 | <strong>Syntax:</strong> TLSStapling <em>on|off</em><br> |
| 1823 | <strong>Default:</strong> off<br> |
| 1824 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 1825 | <strong>Module:</strong> mod_tls<br> |
| 1826 | <strong>Compatibility:</strong> 1.3.6rc2 and later |
| 1827 | |
| 1828 | <p> |
| 1829 | The <code>TLSStapling</code> directive enables |
| 1830 | <a href="https://en.wikipedia.org/wiki/OCSP_stapling">OCSP stapling</a>, |
| 1831 | as defined by the "Certificate Status Request" TLS extension |
| 1832 | (<a href="http://www.faqs.org/rfcs/rfc6066.html">RFC 6066</a>). If |
| 1833 | <code>TLSStapling</code> is enabled, <b>and</b> the certificate status request |
| 1834 | extension is used by the SSL/TLS client, then <code>mod_tls</code> will |
| 1835 | include an OCSP response for the server certificate, in the TLS handshake. |
| 1836 | |
| 1837 | <p> |
| 1838 | By default, <code>TLSStapling</code> is <em>off</em>, but will automatically |
| 1839 | be enabled if a <a href="#TLSStaplingCache"><code>TLSStaplingCache</code></a> |
| 1840 | is configured. |
| 1841 | |
| 1842 | <p> |
| 1843 | See also: <a href="#TLSStaplingCache"><code>TLSStaplingCache</code></a>, |
| 1844 | <a href="#TLSStaplingOptions"><code>TLSStaplingOptions</code></a>, |
| 1845 | <a href="#TLSStaplingResponder"><code>TLSStaplingResponder</code></a>, and |
| 1846 | <a href="#TLSStaplingTimeout"><code>TLSStaplingTimeout</code></a> |
| 1847 | |
| 1848 | <p> |
| 1849 | <hr> |
| 1850 | <h3><a name="TLSStaplingCache">TLSStaplingCache</a></h3> |
| 1851 | <strong>Syntax:</strong> TLSStaplingCache <em>type:/info</em><br> |
| 1852 | <strong>Default:</strong> None<br> |
| 1853 | <strong>Context:</strong> server config<br> |
| 1854 | <strong>Module:</strong> mod_tls<br> |
| 1855 | <strong>Compatibility:</strong> 1.3.6rc2 and later |
| 1856 | |
| 1857 | <p> |
| 1858 | The <code>TLSStaplingCache</code> directive configures an external OCSP response |
| 1859 | cache, which can be used for storing and sharing OCSP responses across multiple |
| 1860 | processes. An external OCSP response cache is an optional facility which |
| 1861 | speeds up TLS handshakes when |
| 1862 | <a href="#TLSStapling"><code>TLSStapling</code></a> is enabled. |
| 1863 | |
| 1864 | <p> |
| 1865 | The <em>type</em> and <em>info</em> parameters all depend on the module |
| 1866 | implementing the external OCSP response cache being configured. For example, |
| 1867 | for using a filesystem-based external OCSP response cache, see the |
| 1868 | <a href="mod_tls_fscache.html"><code>mod_tls_fscache</code></a> documentation, |
| 1869 | or see <a href="mod_tls_shmcache.html"><code>mod_tls_shmcache</code></a> for |
| 1870 | a shared memory-based OCSP response cache, or |
| 1871 | <a href="mod_tls_memcache.html"><code>mod_tls_memcache</code></a> for using |
| 1872 | memcached servers as an OCSP response cache. |
| 1873 | |
| 1874 | <p> |
| 1875 | <hr> |
| 1876 | <h3><a name="TLSStaplingOptions">TLSStaplingOptions</a></h3> |
| 1877 | <strong>Syntax:</strong> TLSStaplingOptions <em>opt1 ...</em><br> |
| 1878 | <strong>Default:</strong> None<br> |
| 1879 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 1880 | <strong>Module:</strong> mod_tls<br> |
| 1881 | <strong>Compatibility:</strong> 1.3.6rc2 and later |
| 1882 | |
| 1883 | <p> |
| 1884 | The <code>TLSStaplingOptions</code> directive configures various optional |
| 1885 | behaviors of <code>mod_tls</code> when querying OCSP responders. |
| 1886 | |
| 1887 | <p> |
| 1888 | The currently implemented options are: |
| 1889 | <ul> |
| 1890 | <li><code>NoFakeTryLater</code><br> |
| 1891 | <p> |
| 1892 | If the TLS client requests a stapled OCSP response, yet <code>mod_tls</code> |
| 1893 | cannot provide one (<i>e.g.</i> due to inability to contact the OCSP |
| 1894 | responder), the module will provide a fake <code>tryLater</code> OCSP |
| 1895 | response. Some client implementations, however, have trouble with such |
| 1896 | fake OCSP responses; use this option to disable the use of such fake OCSP |
| 1897 | response: |
| 1898 | <pre> |
| 1899 | # Skip using a fake tryLater OCSP response, if we cannot obtain one from |
| 1900 | # an OCSP responder |
| 1901 | TLSStaplingOptions NoFakeTryLater |
| 1902 | </pre> |
| 1903 | <b>However</b>, a fake <code>tryLater</code> OCSP response <b>might still |
| 1904 | be emitted</b>, even if this option is used, if the server certificate |
| 1905 | in question bears the "must staple" TLS feature; see |
| 1906 | <a href="https://tools.ietf.org/html/rfc7633#section-3">RFC 7633</a>. In |
| 1907 | such cases, <code>mod_tls</code> is <em>required</em> to staple an OCSP |
| 1908 | response. |
| 1909 | |
| 1910 | <p> |
| 1911 | <b>Note</b> that this option first appeared in |
| 1912 | <code>proftpd-1.3.7rc1</code>. |
| 1913 | </li> |
| 1914 | |
| 1915 | <p> |
| 1916 | <li><code>NoNonce</code><br> |
| 1917 | <p> |
| 1918 | To defend against replay attacks of OCSP responses, the protocol allows |
| 1919 | for a nonce to be included in the request; this nonce is then expected |
| 1920 | to be in the OCSP response. However, many OCSP responders pre-generate |
| 1921 | the OCSP responses, as it less computationally expensive to do so. Thus |
| 1922 | to tell <code>mod_tls</code> to not include a nonce in its OCSP request |
| 1923 | (and not expect to see that nonce in the OCSP response), use this option: |
| 1924 | <pre> |
| 1925 | # Many OCSP responders pregenerate their responses, and thus cannot |
| 1926 | # include nonces in the response. |
| 1927 | TLSStaplingOptions NoNonce |
| 1928 | </pre> |
| 1929 | </li> |
| 1930 | </ul> |
| 1931 | |
| 1932 | <p> |
| 1933 | <hr> |
| 1934 | <h3><a name="TLSStaplingResponder">TLSStaplingResponder</a></h3> |
| 1935 | <strong>Syntax:</strong> TLSStaplingResponder <em>url</em><br> |
| 1936 | <strong>Default:</strong> none<br> |
| 1937 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 1938 | <strong>Module:</strong> mod_tls<br> |
| 1939 | <strong>Compatibility:</strong> 1.3.6rc2 and later |
| 1940 | |
| 1941 | <p> |
| 1942 | The <code>TLSStaplingResponder</code> directive overrides the URL of the OCSP |
| 1943 | responder specified in the "Authority Information Access" certificate extension. |
| 1944 | |
| 1945 | <p> |
| 1946 | Example: |
| 1947 | <pre> |
| 1948 | # Use our own custom OCSP responder |
| 1949 | TLSStaplingResponder http://gw.example.com/ocsp/ |
| 1950 | </pre> |
| 1951 | |
| 1952 | <p> |
| 1953 | <hr> |
| 1954 | <h3><a name="TLSStaplingTimeout">TLSStaplingTimeout</a></h3> |
| 1955 | <strong>Syntax:</strong> TLSStaplingTimeout <em>secs</em><br> |
| 1956 | <strong>Default:</strong> 10s<br> |
| 1957 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 1958 | <strong>Module:</strong> mod_tls<br> |
| 1959 | <strong>Compatibility:</strong> 1.3.6rc2 and later |
| 1960 | |
| 1961 | <p> |
| 1962 | The <code>TLSStaplingTimeout</code> directive sets the timeout for queries |
| 1963 | to OCSP responders when <code>TLSStapling</code> is enabled, and |
| 1964 | <code>mod_tls</code> is querying a responder for OCSP stapling purposes. |
| 1965 | |
| 1966 | <p> |
| 1967 | <hr> |
| 1968 | <h3><a name="TLSTimeoutHandshake">TLSTimeoutHandshake</a></h3> |
| 1969 | <strong>Syntax:</strong> TLSTimeoutHandshake <em>seconds</em><br> |
| 1970 | <strong>Default:</strong> 300<br> |
| 1971 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 1972 | <strong>Module:</strong> mod_tls<br> |
| 1973 | <strong>Compatibility:</strong> 1.2.9rc1 and later |
| 1974 | |
| 1975 | <p> |
| 1976 | The <code>TLSTimeoutHandshake</code> directive configures the maximum number |
| 1977 | of seconds for <code>mod_tls</code> to accept an SSL/TLS handshake. If set to |
| 1978 | zero, <code>mod_tls</code> will wait forever for a handshake to complete. The |
| 1979 | default is 300 seconds (five minutes). |
| 1980 | |
| 1981 | <p> |
| 1982 | <hr> |
| 1983 | <h3><a name="TLSUserName">TLSUserName</a></h3> |
| 1984 | <strong>Syntax:</strong> TLSUserName <em>attribute</em><br> |
| 1985 | <strong>Default:</strong> off<br> |
| 1986 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 1987 | <strong>Module:</strong> mod_tls<br> |
| 1988 | <strong>Compatibility:</strong> 1.3.5rc2 and later |
| 1989 | |
| 1990 | <p> |
| 1991 | The <code>TLSUserName</code> directive configures which <em>attribute</em> |
| 1992 | of a client certificate to match against the name provided by the FTPS client |
| 1993 | in its <code>USER</code> command. If the certificate <em>attribute</em> |
| 1994 | value matches the <code>USER</code> name, the user is considered to be |
| 1995 | authenticated <b>without requiring that password be sent over the network</b>. |
| 1996 | |
| 1997 | <p> |
| 1998 | The <em>attribute</em> can either be "CommonName" (to match the CN of the |
| 1999 | client certificate to the requested <code>USER</code> name), |
| 2000 | "EmailSubjAltName" (to match <b>any</b> Email Subject Alternative Names (SANs) |
| 2001 | to the requested <code>USER</code> name), or a custom OID. |
| 2002 | |
| 2003 | <p> |
| 2004 | Examples: |
| 2005 | <pre> |
| 2006 | # Match the CN |
| 2007 | TLSUserName CommonName |
| 2008 | |
| 2009 | # Match any Email SANs |
| 2010 | TLSUserName EmailSubjAltName |
| 2011 | |
| 2012 | # Match specific (custom) OID |
| 2013 | TLSUserName 1.2.3.4.5 |
| 2014 | </pre> |
| 2015 | |
| 2016 | <p> |
| 2017 | Note that for the <code>TLSUserName</code> directive to be effective, |
| 2018 | <code>mod_tls</code> has to be configured to request that clients provide |
| 2019 | certificates, <i>i.e.</i>: |
| 2020 | <pre> |
| 2021 | # Verify clients |
| 2022 | TLSVerifyClient optional |
| 2023 | |
| 2024 | # and possibly verify the user based on the client certs |
| 2025 | TLSUserName CommonName |
| 2026 | </pre> |
| 2027 | |
| 2028 | <p> |
| 2029 | See also: <a href="#TLSVerifyClient"><code>TLSVerifyClient</code></a> |
| 2030 | |
| 2031 | <p> |
| 2032 | <hr> |
| 2033 | <h3><a name="TLSVerifyClient">TLSVerifyClient</a></h3> |
| 2034 | <strong>Syntax:</strong> TLSVerifyClient <em>on|off|optional</em><br> |
| 2035 | <strong>Default:</strong> off<br> |
| 2036 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 2037 | <strong>Module:</strong> mod_tls<br> |
| 2038 | <strong>Compatibility:</strong> 1.2.7rc1 and later |
| 2039 | |
| 2040 | <p> |
| 2041 | The <code>TLSVerifyClient</code> directive configures how <code>mod_tls</code> |
| 2042 | handles certificates presented by clients. If <em>off</em>, the module |
| 2043 | will not request the client certificate while establishing an SSL/TLS session. |
| 2044 | If <em>on</em>, the module will verify a client's certificate and, furthermore, |
| 2045 | will fail all SSL handshake attempts <b>unless</b> the client presents a |
| 2046 | certificate when the server requests one. If <em>optional</em>, then |
| 2047 | <code>mod_tls</code> will <i>request</i> that a client send its certificate, |
| 2048 | but will not fail the handshake if the client fails to provide a certificate. |
| 2049 | |
| 2050 | <p> |
| 2051 | See also: <a href="#TLSOptions"><code>TLSOptions</code></a> |
| 2052 | |
| 2053 | <p> |
| 2054 | <hr> |
| 2055 | <h3><a name="TLSVerifyDepth">TLSVerifyDepth</a></h3> |
| 2056 | <strong>Syntax:</strong> TLSVerifyDepth <em>depth</em><br> |
| 2057 | <strong>Default:</strong> 9<br> |
| 2058 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 2059 | <strong>Module:</strong> mod_tls<br> |
| 2060 | <strong>Compatibility:</strong> 1.2.7rc1 and later |
| 2061 | |
| 2062 | <p> |
| 2063 | The <code>TLSVerifyDepth</code> directive sets how deeply <code>mod_tls</code> |
| 2064 | should verify before deciding that the client does not have a valid |
| 2065 | certificate. The depth actually is the maximum number of intermediate |
| 2066 | certificate issuers, <i>i.e.</i> the number of CA certificates which are |
| 2067 | allowed to be followed while verifying the client certificate. A depth of 0 |
| 2068 | means that only self-signed client certificates are accepted, a depth of 1 |
| 2069 | means the client certificate can be self-signed or has to be signed by a CA |
| 2070 | which is directly known to the server (<i>i.e.</i> the CA's certificate is |
| 2071 | under <code>TLSCACertificatePath</code>), etc. |
| 2072 | |
| 2073 | <p> |
| 2074 | Example: |
| 2075 | <pre> |
| 2076 | TLSVerifyDepth 10 |
| 2077 | </pre> |
| 2078 | |
| 2079 | <p> |
| 2080 | <hr> |
| 2081 | <h3><a name="TLSVerifyOrder">TLSVerifyOrder</a></h3> |
| 2082 | <strong>Syntax:</strong> TLSVerifyOrder <em>crl|ocsp</em><br> |
| 2083 | <strong>Default:</strong> crl<br> |
| 2084 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 2085 | <strong>Module:</strong> mod_tls<br> |
| 2086 | <strong>Compatibility:</strong> 1.3.2rc1 and later |
| 2087 | |
| 2088 | <p> |
| 2089 | The <code>TLSVerifyOrder</code> directive configures how the |
| 2090 | <code>mod_tls</code> will verify the certificates presented by clients, if |
| 2091 | at all. Unless <code>TLSVerifyClient</code> is <em>on</em>, the |
| 2092 | <code>TLSVerifyOrder</code> directive is not needed. |
| 2093 | |
| 2094 | <p> |
| 2095 | By default, the <code>mod_tls</code> module will include any CRLs (Certificate |
| 2096 | Revocation List) that may have been configured via the |
| 2097 | <code>TLSCARevocationFile</code> and/or <code>TLSCARevocationPath</code> |
| 2098 | directives. This default behavior is the equivalent of configuring the |
| 2099 | <code>TLSVerifyOrder</code> to use CRLs, <i>e.g.</i>: |
| 2100 | <pre> |
| 2101 | TLSVerifyOrder crl |
| 2102 | </pre> |
| 2103 | |
| 2104 | <p> |
| 2105 | Another way of checking the validity of the client certificate is to use |
| 2106 | the Online Certificate Status Protocol (OCSP), defined in |
| 2107 | <a href="http://www.faqs.org/rfcs/rfc2560.html">RFC 2560</a>. To configure |
| 2108 | the <code>mod_tls</code> module to use OCSP when verifying, use: |
| 2109 | <pre> |
| 2110 | TLSVerifyOrder ocsp |
| 2111 | </pre> |
| 2112 | Note that at is possible for <code>mod_tls</code> to use both CRLs <i>and</i> |
| 2113 | OCSP when verifying certificates. Simply use <code>TLSVerifyOrder</code> |
| 2114 | to configure the order in which <code>mod_tls</code> should use the various |
| 2115 | verification mechanisms: |
| 2116 | <pre> |
| 2117 | TLSVerifyOrder ocsp crl |
| 2118 | </pre> |
| 2119 | Verification ends when a mechanism can successfully verify the certificate. |
| 2120 | |
| 2121 | <p> |
| 2122 | See also: <a href="#TLSCARevocationFile"><code>TLSCARevocationFile</code></a>, |
| 2123 | <a href="#TLSCARevocationPath"><code>TLSCARevocationPath</code></a> |
| 2124 | |
| 2125 | <p> |
| 2126 | <hr> |
| 2127 | <h3><a name="TLSVerifyServer">TLSVerifyServer</a></h3> |
| 2128 | <strong>Syntax:</strong> TLSVerifyServer <em>on|off|NoReverseDNS</em><br> |
| 2129 | <strong>Default:</strong> on<br> |
| 2130 | <strong>Context:</strong> server config, <code><VirtualHost></code>, <code><Global></code><br> |
| 2131 | <strong>Module:</strong> mod_tls<br> |
| 2132 | <strong>Compatibility:</strong> 1.3.5rc4 and later |
| 2133 | |
| 2134 | <p> |
| 2135 | The <code>TLSVerifyServer</code> directive configures how <code>mod_tls</code> |
| 2136 | handles certificates presented by <em>other servers</em>, during a secure |
| 2137 | site-to-site (<i>a.k.a.</i> "secure FXP") transfer. If <em>off</em>, the |
| 2138 | module will accept the certificate and establish an SSL/TLS session, but will |
| 2139 | <b>not</b> verify the certificate. If <em>on</em>, the module will verify a |
| 2140 | server's certificate and, furthermore, will fail all SSL handshake attempts |
| 2141 | <b>unless</b> the server presents a valid certificate. |
| 2142 | |
| 2143 | <p> |
| 2144 | The <em>NoReverseDNS</em> parameter tells <code>mod_tls</code> to validate |
| 2145 | the server's certificate, <b>but</b> to only validate it based on IP address, |
| 2146 | rather than using DNS names (for <i>e.g.</i> CommonName (CN) and DNS |
| 2147 | SubjectAltName (SAN) checks). The recommended certificate validation |
| 2148 | techniques use DNS names, so using <em>NoReverseDNS</em> performs less |
| 2149 | strict validations. Unfortunately, in most secure site-to-site transfers, |
| 2150 | this setting may be required since FTP site-to-site transfers send IP |
| 2151 | addresses, not DNS names, in the command which establish the data transfer. |
| 2152 | |
| 2153 | <p> |
| 2154 | See also: <a href="#TLSVerifyClient"><code>TLSVerifyClient</code></a>, |
| 2155 | <a href="#TLSVerifyDepth"><code>TLSVerifyDepth</code></a> |
| 2156 | |
| 2157 | <p> |
| 2158 | <hr> |
| 2159 | <h2>Control Actions</h2> |
| 2160 | |
| 2161 | <p> |
| 2162 | <hr> |
| 2163 | <h3><a name="tls_sesscache_clear"><code>tls sesscache clear</code></a></h3> |
| 2164 | <strong>Syntax:</strong> ftpdctl tls sesscache clear<br> |
| 2165 | <strong>Purpose:</strong> Clears all cached sessions from the SSL session cache<br> |
| 2166 | |
| 2167 | <p> |
| 2168 | The <code>tls sesscache clear</code> action is used to clear all cached |
| 2169 | sessions, whether they have expired or not, from the configured external |
| 2170 | SSL session cache. For example: |
| 2171 | <pre> |
| 2172 | # ftpdctl tls sesscache clear |
| 2173 | ftpdctl: tls sesscache: cleared 1 session from 'shm' session cache |
| 2174 | </pre> |
| 2175 | |
| 2176 | <p> |
| 2177 | See also: <a href="#TLSSessionCache"><code>TLSSessionCache</code></a> |
| 2178 | |
| 2179 | <p> |
| 2180 | <hr> |
| 2181 | <h3><a name="tls_sesscache_info"><code>tls sesscache info</code></a></h3> |
| 2182 | <strong>Syntax:</strong> ftpdctl tls sesscache info <em>[-v]</em><br> |
| 2183 | <strong>Purpose:</strong> Displays status of session cache<br> |
| 2184 | |
| 2185 | <p> |
| 2186 | The <code>tls sesscache info</code> action is used to display information |
| 2187 | about the configured external SSL session cache. If the optional <em>-v</em> |
| 2188 | command-line option is used, then information about each cached session |
| 2189 | will also be displayed. |
| 2190 | |
| 2191 | <p> |
| 2192 | For example: |
| 2193 | <pre> |
| 2194 | # ftpdctl tls sesscache info -v |
| 2195 | ftpdctl: Shared memory (shm) SSL session cache provided by mod_tls_shmcache/0.1 |
| 2196 | ftpdctl: |
| 2197 | ftpdctl: Shared memory segment ID: 589824 |
| 2198 | ftpdctl: Shared memory segment size: 1576960 bytes |
| 2199 | ftpdctl: Shared memory cache created on: Mon Mar 9 21:18:05 2009 |
| 2200 | ftpdctl: Shared memory attach count: 1 |
| 2201 | ftpdctl: |
| 2202 | ftpdctl: Max session cache size: 153 |
| 2203 | ftpdctl: Current session cache size: 1 |
| 2204 | ftpdctl: |
| 2205 | ftpdctl: Cache lifetime hits: 0 |
| 2206 | ftpdctl: Cache lifetime misses: 0 |
| 2207 | ftpdctl: |
| 2208 | ftpdctl: Cache lifetime sessions stored: 1 |
| 2209 | ftpdctl: Cache lifetime sessions deleted: 0 |
| 2210 | ftpdctl: Cache lifetime sessions expired: 0 |
| 2211 | ftpdctl: |
| 2212 | ftpdctl: Cache lifetime errors handling sessions in cache: 0 |
| 2213 | ftpdctl: Cache lifetime sessions exceeding max entry size: 0 |
| 2214 | ftpdctl: |
| 2215 | ftpdctl: Cached sessions: |
| 2216 | ftpdctl: -----BEGIN SSL SESSION PARAMETERS----- |
| 2217 | ftpdctl: Session ID: A9BB647E236BAB0EF128FE9EAD2ABEC6F8E65C9EB8F050A07D1F0F66EC3019DC |
| 2218 | ftpdctl: Session ID Context: 00000000 |
| 2219 | ftpdctl: Protocol: TLSv1 |
| 2220 | ftpdctl: Started: Mon Mar 9 21:19:20 2009 |
| 2221 | ftpdctl: Expires: Tue Mar 10 21:19:20 2009 (86400 secs) |
| 2222 | ftpdctl: -----END SSL SESSION PARAMETERS----- |
| 2223 | </pre> |
| 2224 | |
| 2225 | <p> |
| 2226 | See also: <a href="#TLSSessionCache"><code>TLSSessionCache</code></a> |
| 2227 | |
| 2228 | <p> |
| 2229 | <hr> |
| 2230 | <h3><a name="tls_sesscache_remove"><code>tls sesscache remove</code></a></h3> |
| 2231 | <strong>Syntax:</strong> ftpdctl tls sesscache remove<br> |
| 2232 | <strong>Purpose:</strong> Removes the external SSL session cache<br> |
| 2233 | |
| 2234 | <p> |
| 2235 | The <code>tls sesscache remove</code> action is used to remove the |
| 2236 | external SSL session cache entirely. Depending on the actual module providing |
| 2237 | the session cache, this may or may not be implemented. |
| 2238 | |
| 2239 | <p> |
| 2240 | For example: |
| 2241 | <pre> |
| 2242 | # ftpdctl tls sesscache remove |
| 2243 | ftpdctl: tls sesscache: removed 'shm' session cache |
| 2244 | </pre> |
| 2245 | |
| 2246 | <p> |
| 2247 | See also: <a href="#TLSSessionCache"><code>TLSSessionCache</code></a> |
| 2248 | |
| 2249 | <p> |
| 2250 | <hr> |
| 2251 | <h2><a name="Usage">Usage</a></h2> |
| 2252 | Much of the documentation for Apache's <code>mod_ssl</code>, concerning |
| 2253 | certificates, OpenSSL usage, <i>etc</i> applies to this module as well: |
| 2254 | <pre> |
| 2255 | <a href="http://httpd.apache.org/docs/2.4/mod/mod_ssl.html">http://httpd.apache.org/docs/2.4/mod/mod_ssl.html</a> |
| 2256 | </pre> |
| 2257 | The OpenSSL documentation, and its |
| 2258 | <a href="http://www.openssl.org/support/faq.cgi">FAQ</a>, are recommended as |
| 2259 | well: |
| 2260 | <pre> |
| 2261 | <a href="http://www.openssl.org/docs/">http://www.openssl.org/docs/</a> |
| 2262 | </pre> |
| 2263 | |
| 2264 | <p> |
| 2265 | There is also a script, <code>cert-tool</code>, that can help in the creation |
| 2266 | of certificates. See <code>cert-tool --help</code> for usage information: |
| 2267 | <pre> |
| 2268 | <a href="http://www.castaglia.org/openssl/contrib/cert-tool">http://www.castaglia.org/openssl/contrib/cert-tool</a> |
| 2269 | </pre> |
| 2270 | |
| 2271 | <p> |
| 2272 | A copy of the Draft describing FTP over SSL/TLS is included with the source |
| 2273 | code for this module. |
| 2274 | |
| 2275 | <p> |
| 2276 | <b>Logging</b><br> |
| 2277 | The <code>mod_tls</code> module supports <a href="../howto/Tracing.html">trace logging</a>, via the module-specific log channels: |
| 2278 | <ul> |
| 2279 | <li>tls |
| 2280 | </ul> |
| 2281 | Thus for trace logging, to aid in debugging, you would use the following in |
| 2282 | your <code>proftpd.conf</code>: |
| 2283 | <pre> |
| 2284 | TraceLog /path/to/ftpd/trace.log |
| 2285 | Trace tls:20 |
| 2286 | </pre> |
| 2287 | This trace logging can generate large files; it is intended for debugging use |
| 2288 | only, and should be removed from any production configuration. |
| 2289 | |
| 2290 | <p> |
| 2291 | <b>Note Variables</b><br> |
| 2292 | The <code>mod_tls</code> module provides the following <em>notes</em>, for use |
| 2293 | via the <code>%{note:...}</code> syntax: |
| 2294 | <ul> |
| 2295 | <li><code>FTPS</code> |
| 2296 | <li><code>TLS_PROTOCOL</code> |
| 2297 | <li><code>TLS_CIPHER</code> |
| 2298 | <li><code>TLS_LIBRARY_VERSION</code> |
| 2299 | </ul> |
| 2300 | These <em>notes</em> are similar to the environment variables provided when |
| 2301 | <code>TLSOptions StdEnvVars</code> is used. |
| 2302 | |
| 2303 | <p><a name="FAQ"> |
| 2304 | <b>Frequently Asked Questions</b><br> |
| 2305 | |
| 2306 | <p><a name="TLSJavaDH"> |
| 2307 | <font color=red>Question</font>: When I use a Java client to connect to my |
| 2308 | <code>proftpd</code> server using FTPS, it fails with exceptions such as: |
| 2309 | <pre> |
| 2310 | java.lang.RuntimeException: Could not generate DH keypair and java.security.InvalidAlgorithmParameterException: Prime size must be multiple of 64, and can only range from 512 to 1024 (inclusive) |
| 2311 | </pre> |
| 2312 | How can I fix this?<br> |
| 2313 | <font color=blue>Answer</font>: This happens because <code>mod_tls</code> tries |
| 2314 | to use longer DH parameter lengths when it can, but not all clients support |
| 2315 | longer DH parameter lengths. |
| 2316 | |
| 2317 | <p> |
| 2318 | To address this, you need to configure a custom 1024-bit DH parameter via the |
| 2319 | <a href="#TLSDHParamFile"><code>TLSDHParamFile</code></a> directive. You |
| 2320 | can generate a custom DH parameter using <code>openssl dhparam</code>, |
| 2321 | <i>e.g.</i>: |
| 2322 | <pre> |
| 2323 | $ openssl dhparam -outform PEM -5 1024 > dh1024.pem |
| 2324 | </pre> |
| 2325 | Alternatively, you can append the following standard 1024-bit DH parameters |
| 2326 | from <a href="http://www.faqs.org/rfcs/rfc2409">RFC 2409</a>, section 6.2, |
| 2327 | into a <code>dh1024.pem</code> file: |
| 2328 | <pre> |
| 2329 | -----BEGIN DH PARAMETERS----- |
| 2330 | MIGHAoGBAP//////////yQ/aoiFowjTExmKLgNwc0SkCTgiKZ8x0Agu+pjsTmyJR |
| 2331 | Sgh5jjQE3e+VGbPNOkMbMCsKbfJfFDdP4TVtbVHCReSFtXZiXn7G9ExC6aY37WsL |
| 2332 | /1y29Aa37e44a/taiZ+lrp8kEXxLH+ZJKGZR7OZTgf//////////AgEC |
| 2333 | -----END DH PARAMETERS----- |
| 2334 | </pre> |
| 2335 | Then tell <code>mod_tls</code> to use that DH parameter: |
| 2336 | <pre> |
| 2337 | # Use 1024-bit DH parameters for the Java clients |
| 2338 | TLSDHParamFile /path/to/dh1024.pem |
| 2339 | </pre> |
| 2340 | |
| 2341 | <p><a name="TLSNoCipherMatch"> |
| 2342 | <font color=red>Question</font>: I tried to configure a specific ciphersuite |
| 2343 | using <code>TLSCipherSuite</code>, but ProFTPD fails on startup with this error: |
| 2344 | <pre> |
| 2345 | fatal: TLSCipherSuite: unable to use configured TLSCipherSuite '!EXPORT:MYCIPHER': |
| 2346 | (1) error:1410D0B9:SSL routines:SSL_CTX_set_cipher_list:no cipher match on line 16 of '/etc/proftpd/tls.conf' |
| 2347 | </pre> |
| 2348 | <font color=blue>Answer</font>: This error indicates that the version of OpenSSL |
| 2349 | does not recognize/support one of the ciphers that you configured in your |
| 2350 | <code>TLSCipherSuite</code> list. Unfortunately the OpenSSL error reporting |
| 2351 | does not pinpoint <i>which</i> is the offending ciphersuite; experimenting |
| 2352 | with your cipher list will reveal which ones are problematic. |
| 2353 | |
| 2354 | <p><a name="TLSRequiredNoPassword"> |
| 2355 | <font color=red>Question</font>: I want to require TLS for most users, but not |
| 2356 | all of them. When TLS is required for a user, and they have not performed |
| 2357 | the TLS handshake, I want to prevent them from sending their password in |
| 2358 | plaintext. Is this possible?<br> |
| 2359 | <font color=blue>Answer</font>: Yes, this is possible with the |
| 2360 | <code>mod_ifsession</code> module: |
| 2361 | <pre> |
| 2362 | <IfModule mod_tls.c> |
| 2363 | TLSEngine on |
| 2364 | ... |
| 2365 | TLSRequired on |
| 2366 | TLSOptions AllowPerUser |
| 2367 | </IfModule> |
| 2368 | |
| 2369 | <IfModule mod_ifsession.c> |
| 2370 | # This is required for this use case |
| 2371 | IfSessionOptions PerUnauthenticatedUser |
| 2372 | |
| 2373 | <IfUser ftp> |
| 2374 | TLSRequired off |
| 2375 | </IfUser> |
| 2376 | </IfModule> |
| 2377 | </pre> |
| 2378 | |
| 2379 | <p> |
| 2380 | <hr> |
| 2381 | <h2><a name="Installation">Installation</a></h2> |
| 2382 | The <code>mod_tls</code> module is distributed with ProFTPD. Simply follow |
| 2383 | the normal steps for using third-party modules in ProFTPD: |
| 2384 | <pre> |
| 2385 | $ ./configure --with-modules=mod_tls |
| 2386 | $ make |
| 2387 | $ make install |
| 2388 | </pre> |
| 2389 | Alternatively, <code>mod_tls</code> can be built as a DSO module: |
| 2390 | <pre> |
| 2391 | $ ./configure --enable-dso --with-shared=mod_tls ... |
| 2392 | </pre> |
| 2393 | Then follow the usual steps: |
| 2394 | <pre> |
| 2395 | $ make |
| 2396 | $ make install |
| 2397 | </pre> |
| 2398 | |
| 2399 | <p> |
| 2400 | You may need to specify the location of the OpenSSL header and library files |
| 2401 | in your <code>configure</code> command, <i>e.g.</i>: |
| 2402 | <pre> |
| 2403 | $ ./configure --with-modules=mod_tls \ |
| 2404 | --with-includes=/usr/local/openssl \ |
| 2405 | --with-libraries=/usr/local/openssl |
| 2406 | </pre> |
| 2407 | |
| 2408 | <p> |
| 2409 | <hr> |
| 2410 | <font size=2><b><i> |
| 2411 | © Copyright 2002-2023 TJ Saunders<br> |
| 2412 | All Rights Reserved<br> |
| 2413 | </i></b></font> |
| 2414 | <hr> |
| 2415 | |
| 2416 | </body> |
| 2417 | </html> |