Skip to content

Commit

Permalink
address PR comments:
Browse files Browse the repository at this point in the history
* add software architecture information on top of the connection chapter
* resolve a nit
  • Loading branch information
Boquan Fang committed Nov 6, 2024
1 parent 0e84ec8 commit 72e731d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/usage-guide/topics/ch04-connection.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# TLS Connections

Users interact with s2n-tls primarily through the `s2n_connection` and `s2n_config` structures. Users should build a `s2n_config` object and `s2n_connection` objects, associate the config with those connections, and then calling `s2n_negotiate()` on those connections until the TLS handshakes are completed. Users should then call `s2n_send`/`s2n_recv` on those connections to send and receive application data.

Users will need to create a `s2n_connection` struct to store all of the state necessary for a TLS connection. One `s2n_connection` must be created for each TCP stream. Call `s2n_connection_new()` to create a new server or client connection. Call `s2n_connection_free()` to free the memory allocated for this struct when no longer needed.

## Connection Memory
Expand Down
2 changes: 1 addition & 1 deletion docs/usage-guide/topics/ch05-config.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Configuring the Connection

`s2n_config` objects are used to change the default settings of a s2n-tls connection, such as loading the certificate, configuring session resumption, etc. Use `s2n_config_new()` to create a new config object. To associate a config with a connection call `s2n_connection_set_config()`. Users should complete all configurations before associating config with a connection. Mutating the config after association will produce undefined behavior. It is not necessary to create a config object per connection; one config object should be used for many connections. Call `s2n_config_free()` to free the object when no longer needed. _Only_ free the config object when all connections using it have been freed.
`s2n_config` objects are used to change the default settings of a s2n-tls connection, such as loading the certificate, configuring session resumption, etc. Use `s2n_config_new()` to create a new config object. To associate a config with a connection call `s2n_connection_set_config()`. Users should complete all configuration before associating config with a connection. Mutating the config after association will produce undefined behavior. It is not necessary to create a config object per connection; one config object should be used for many connections. Call `s2n_config_free()` to free the object when no longer needed. _Only_ free the config object when all connections using it have been freed.

Calling `s2n_config_new()` can have a performance cost during config creation due to loading
default system certificates into the trust store (see [Configuring the Trust Store](./ch09-certificates.md#configuring-the-trust-store)).
Expand Down

0 comments on commit 72e731d

Please sign in to comment.