diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libtls/tls_init.3 | 63 |
1 files changed, 16 insertions, 47 deletions
diff --git a/src/lib/libtls/tls_init.3 b/src/lib/libtls/tls_init.3 index 4d7367408b..f9a8ac1f80 100644 --- a/src/lib/libtls/tls_init.3 +++ b/src/lib/libtls/tls_init.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: tls_init.3,v 1.67 2016/08/22 14:55:59 jsing Exp $ | 1 | .\" $OpenBSD: tls_init.3,v 1.68 2016/09/04 12:03:24 jsing Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org> | 3 | .\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org> |
| 4 | .\" | 4 | .\" |
| @@ -14,7 +14,7 @@ | |||
| 14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 16 | .\" | 16 | .\" |
| 17 | .Dd $Mdocdate: August 22 2016 $ | 17 | .Dd $Mdocdate: September 4 2016 $ |
| 18 | .Dt TLS_INIT 3 | 18 | .Dt TLS_INIT 3 |
| 19 | .Os | 19 | .Os |
| 20 | .Sh NAME | 20 | .Sh NAME |
| @@ -307,45 +307,38 @@ then it is removed from the list of available protocols, rather than being | |||
| 307 | added to it. | 307 | added to it. |
| 308 | .Pp | 308 | .Pp |
| 309 | The following functions modify a configuration by setting parameters (the | 309 | The following functions modify a configuration by setting parameters (the |
| 310 | configuration options may only apply to clients, to servers or to both): | 310 | configuration options apply to both clients and servers, unless noted |
| 311 | otherwise): | ||
| 311 | .Bl -bullet -offset four | 312 | .Bl -bullet -offset four |
| 312 | .It | 313 | .It |
| 313 | .Fn tls_config_add_keypair_file | 314 | .Fn tls_config_add_keypair_file |
| 314 | adds an additional public certificate and private key from the specified files, | 315 | adds an additional public certificate and private key from the specified files, |
| 315 | used as an alternative certificate for Server Name Indication. | 316 | used as an alternative certificate for Server Name Indication (server only). |
| 316 | .Em (Server) | ||
| 317 | .It | 317 | .It |
| 318 | .Fn tls_config_set_keypair_mem | 318 | .Fn tls_config_set_keypair_mem |
| 319 | adds an additional public certificate and private key from memory, | 319 | adds an additional public certificate and private key from memory, |
| 320 | used as an alternative certificate for Server Name Indication. | 320 | used as an alternative certificate for Server Name Indication (server only). |
| 321 | .Em (Server) | ||
| 322 | .It | 321 | .It |
| 323 | .Fn tls_config_set_alpn | 322 | .Fn tls_config_set_alpn |
| 324 | sets the ALPN protocols that are supported. | 323 | sets the ALPN protocols that are supported. |
| 325 | The alpn string is a comma separated list of protocols, in order of preference. | 324 | The alpn string is a comma separated list of protocols, in order of preference. |
| 326 | .Em (Client and Server) | ||
| 327 | .It | 325 | .It |
| 328 | .Fn tls_config_set_ca_file | 326 | .Fn tls_config_set_ca_file |
| 329 | sets the filename used to load a file | 327 | sets the filename used to load a file |
| 330 | containing the root certificates. | 328 | containing the root certificates. |
| 331 | .Em (Client and Server) | ||
| 332 | .It | 329 | .It |
| 333 | .Fn tls_config_set_ca_path | 330 | .Fn tls_config_set_ca_path |
| 334 | sets the path (directory) which should be searched for root | 331 | sets the path (directory) which should be searched for root |
| 335 | certificates. | 332 | certificates. |
| 336 | .Em (Client and Server) | ||
| 337 | .It | 333 | .It |
| 338 | .Fn tls_config_set_ca_mem | 334 | .Fn tls_config_set_ca_mem |
| 339 | sets the root certificates directly from memory. | 335 | sets the root certificates directly from memory. |
| 340 | .Em (Client and Server) | ||
| 341 | .It | 336 | .It |
| 342 | .Fn tls_config_set_cert_file | 337 | .Fn tls_config_set_cert_file |
| 343 | sets file from which the public certificate will be read. | 338 | sets file from which the public certificate will be read. |
| 344 | .Em (Client and server) | ||
| 345 | .It | 339 | .It |
| 346 | .Fn tls_config_set_cert_mem | 340 | .Fn tls_config_set_cert_mem |
| 347 | sets the public certificate directly from memory. | 341 | sets the public certificate directly from memory. |
| 348 | .Em (Client and server) | ||
| 349 | .It | 342 | .It |
| 350 | .Fn tls_config_set_ciphers | 343 | .Fn tls_config_set_ciphers |
| 351 | sets the list of ciphers that may be used. | 344 | sets the list of ciphers that may be used. |
| @@ -363,24 +356,18 @@ Alternatively, libssl cipher strings can be specified. | |||
| 363 | See the CIPHERS section of | 356 | See the CIPHERS section of |
| 364 | .Xr openssl 1 | 357 | .Xr openssl 1 |
| 365 | for further information. | 358 | for further information. |
| 366 | .Pp | ||
| 367 | .Em (Client and server) | ||
| 368 | .It | 359 | .It |
| 369 | .Fn tls_config_set_key_file | 360 | .Fn tls_config_set_key_file |
| 370 | sets the file from which the private key will be read. | 361 | sets the file from which the private key will be read. |
| 371 | .Em (Client and server) | ||
| 372 | .It | 362 | .It |
| 373 | .Fn tls_config_set_key_mem | 363 | .Fn tls_config_set_key_mem |
| 374 | directly sets the private key from memory. | 364 | directly sets the private key from memory. |
| 375 | .Em (Client and server) | ||
| 376 | .It | 365 | .It |
| 377 | .Fn tls_config_set_keypair_file | 366 | .Fn tls_config_set_keypair_file |
| 378 | sets the files from which the public certificate and private key will be read. | 367 | sets the files from which the public certificate and private key will be read. |
| 379 | .Em (Client and server) | ||
| 380 | .It | 368 | .It |
| 381 | .Fn tls_config_set_keypair_mem | 369 | .Fn tls_config_set_keypair_mem |
| 382 | directly sets the public certificate and private key from memory. | 370 | directly sets the public certificate and private key from memory. |
| 383 | .Em (Client and server) | ||
| 384 | .It | 371 | .It |
| 385 | .Fn tls_config_set_protocols | 372 | .Fn tls_config_set_protocols |
| 386 | sets which versions of the protocol may be used. | 373 | sets which versions of the protocol may be used. |
| @@ -399,56 +386,48 @@ Additionally, the values | |||
| 399 | (all supported protocols) and | 386 | (all supported protocols) and |
| 400 | .Dv TLS_PROTOCOLS_DEFAULT | 387 | .Dv TLS_PROTOCOLS_DEFAULT |
| 401 | (TLSv1.2 only) may be used. | 388 | (TLSv1.2 only) may be used. |
| 402 | .Em (Client and server) | ||
| 403 | .It | 389 | .It |
| 404 | .Fn tls_config_prefer_ciphers_client | 390 | .Fn tls_config_prefer_ciphers_client |
| 405 | prefers ciphers in the client's cipher list when selecting a cipher suite. | 391 | prefers ciphers in the client's cipher list when selecting a cipher suite |
| 392 | (server only). | ||
| 406 | This is considered to be less secure than preferring the server's list. | 393 | This is considered to be less secure than preferring the server's list. |
| 407 | .Em (Server) | ||
| 408 | .It | 394 | .It |
| 409 | .Fn tls_config_prefer_ciphers_server | 395 | .Fn tls_config_prefer_ciphers_server |
| 410 | prefers ciphers in the server's cipher list when selecting a cipher suite. | 396 | prefers ciphers in the server's cipher list when selecting a cipher suite |
| 397 | (server only). | ||
| 411 | This is considered to be more secure than preferring the client's list and is | 398 | This is considered to be more secure than preferring the client's list and is |
| 412 | the default. | 399 | the default. |
| 413 | .Em (Server) | ||
| 414 | .It | 400 | .It |
| 415 | .Fn tls_config_clear_keys | 401 | .Fn tls_config_clear_keys |
| 416 | clears any secret keys from memory. | 402 | clears any secret keys from memory. |
| 417 | .Em (Server) | ||
| 418 | .It | 403 | .It |
| 419 | .Fn tls_config_insecure_noverifycert | 404 | .Fn tls_config_insecure_noverifycert |
| 420 | disables certificate verification. | 405 | disables certificate verification. |
| 421 | Be extremely careful when using this option. | 406 | Be extremely careful when using this option. |
| 422 | .Em (Client and server) | ||
| 423 | .It | 407 | .It |
| 424 | .Fn tls_config_insecure_noverifyname | 408 | .Fn tls_config_insecure_noverifyname |
| 425 | disables server name verification. | 409 | disables server name verification (client only). |
| 426 | Be careful when using this option. | 410 | Be careful when using this option. |
| 427 | .Em (Client) | ||
| 428 | .It | 411 | .It |
| 429 | .Fn tls_config_insecure_noverifytime | 412 | .Fn tls_config_insecure_noverifytime |
| 430 | disables validity checking of certificates. | 413 | disables validity checking of certificates. |
| 431 | Be careful when using this option. | 414 | Be careful when using this option. |
| 432 | .Em (Client and server) | ||
| 433 | .It | 415 | .It |
| 434 | .Fn tls_config_verify | 416 | .Fn tls_config_verify |
| 435 | reenables server name and certificate verification. | 417 | reenables server name and certificate verification. |
| 436 | .Em (Client) | ||
| 437 | .It | 418 | .It |
| 438 | .Fn tls_config_verify_client | 419 | .Fn tls_config_verify_client |
| 439 | enables client certificate verification, requiring the client to send | 420 | enables client certificate verification, requiring the client to send |
| 440 | a certificate. | 421 | a certificate (server only). |
| 441 | .Em (Server) | ||
| 442 | .It | 422 | .It |
| 443 | .Fn tls_config_verify_client_optional | 423 | .Fn tls_config_verify_client_optional |
| 444 | enables client certificate verification, without requiring the client | 424 | enables client certificate verification, without requiring the client |
| 445 | to send a certificate. | 425 | to send a certificate (server only). |
| 446 | .Em (Server) | ||
| 447 | .El | 426 | .El |
| 448 | .Pp | 427 | .Pp |
| 449 | The following functions return information about a TLS connection and will only | 428 | The following functions return information about a TLS connection and will only |
| 450 | succeed after the handshake is complete (the connection information may only | 429 | succeed after the handshake is complete (the connection information applies |
| 451 | apply to clients, to servers or to both): | 430 | to both clients and servers, unless noted otherwise): |
| 452 | .Bl -bullet -offset four | 431 | .Bl -bullet -offset four |
| 453 | .It | 432 | .It |
| 454 | .Fn tls_conn_alpn_selected | 433 | .Fn tls_conn_alpn_selected |
| @@ -456,19 +435,16 @@ returns a string that specifies the ALPN protocol selected for use with the peer | |||
| 456 | connected to | 435 | connected to |
| 457 | .Ar ctx . | 436 | .Ar ctx . |
| 458 | If no protocol was selected then NULL is returned. | 437 | If no protocol was selected then NULL is returned. |
| 459 | .Em (Server and Client) | ||
| 460 | .It | 438 | .It |
| 461 | .Fn tls_conn_cipher | 439 | .Fn tls_conn_cipher |
| 462 | returns a string corresponding to the cipher suite negotiated with the peer | 440 | returns a string corresponding to the cipher suite negotiated with the peer |
| 463 | connected to | 441 | connected to |
| 464 | .Ar ctx . | 442 | .Ar ctx . |
| 465 | .Em (Server and client) | ||
| 466 | .It | 443 | .It |
| 467 | .Fn tls_conn_servername | 444 | .Fn tls_conn_servername |
| 468 | returns a string corresponding to the servername that the client connected to | 445 | returns a string corresponding to the servername that the client connected to |
| 469 | .Ar ctx | 446 | .Ar ctx |
| 470 | requested by sending a TLS Server Name Indication extension. | 447 | requested by sending a TLS Server Name Indication extension (server only). |
| 471 | .Em (Server) | ||
| 472 | .It | 448 | .It |
| 473 | .Fn tls_conn_version | 449 | .Fn tls_conn_version |
| 474 | returns a string corresponding to a TLS version negotiated with the peer | 450 | returns a string corresponding to a TLS version negotiated with the peer |
| @@ -479,7 +455,6 @@ connected to | |||
| 479 | checks if the peer of | 455 | checks if the peer of |
| 480 | .Ar ctx | 456 | .Ar ctx |
| 481 | has provided a certificate. | 457 | has provided a certificate. |
| 482 | .Em (Server and client) | ||
| 483 | .It | 458 | .It |
| 484 | .Fn tls_peer_cert_contains_name | 459 | .Fn tls_peer_cert_contains_name |
| 485 | checks if the peer of a TLS | 460 | checks if the peer of a TLS |
| @@ -487,19 +462,16 @@ checks if the peer of a TLS | |||
| 487 | has provided a certificate that contains a | 462 | has provided a certificate that contains a |
| 488 | SAN or CN that matches | 463 | SAN or CN that matches |
| 489 | .Ar name . | 464 | .Ar name . |
| 490 | .Em (Server and client) | ||
| 491 | .It | 465 | .It |
| 492 | .Fn tls_peer_cert_subject | 466 | .Fn tls_peer_cert_subject |
| 493 | returns a string | 467 | returns a string |
| 494 | corresponding to the subject of the peer certificate from | 468 | corresponding to the subject of the peer certificate from |
| 495 | .Ar ctx . | 469 | .Ar ctx . |
| 496 | .Em (Server and client) | ||
| 497 | .It | 470 | .It |
| 498 | .Fn tls_peer_cert_issuer | 471 | .Fn tls_peer_cert_issuer |
| 499 | returns a string | 472 | returns a string |
| 500 | corresponding to the issuer of the peer certificate from | 473 | corresponding to the issuer of the peer certificate from |
| 501 | .Ar ctx . | 474 | .Ar ctx . |
| 502 | .Em (Server and client) | ||
| 503 | .It | 475 | .It |
| 504 | .Fn tls_peer_cert_hash | 476 | .Fn tls_peer_cert_hash |
| 505 | returns a string | 477 | returns a string |
| @@ -520,13 +492,11 @@ printf "SHA256:${h}\\n" | |||
| 520 | returns the time corresponding to the start of the validity period of | 492 | returns the time corresponding to the start of the validity period of |
| 521 | the peer certificate from | 493 | the peer certificate from |
| 522 | .Ar ctx . | 494 | .Ar ctx . |
| 523 | .Em (Server and client) | ||
| 524 | .It | 495 | .It |
| 525 | .Fn tls_peer_cert_notafter | 496 | .Fn tls_peer_cert_notafter |
| 526 | returns the time corresponding to the end of the validity period of | 497 | returns the time corresponding to the end of the validity period of |
| 527 | the peer certificate from | 498 | the peer certificate from |
| 528 | .Ar ctx . | 499 | .Ar ctx . |
| 529 | .Em (Server and client) | ||
| 530 | .El | 500 | .El |
| 531 | .Pp | 501 | .Pp |
| 532 | The following are TLS related utility functions: | 502 | The following are TLS related utility functions: |
| @@ -541,7 +511,6 @@ or | |||
| 541 | A private key will be decrypted if the optional | 511 | A private key will be decrypted if the optional |
| 542 | .Ar password | 512 | .Ar password |
| 543 | argument is specified. | 513 | argument is specified. |
| 544 | .Em (Client and server) | ||
| 545 | .El | 514 | .El |
| 546 | .Pp | 515 | .Pp |
| 547 | The following functions create, prepare, and free a connection context: | 516 | The following functions create, prepare, and free a connection context: |
