bneradt commented on code in PR #12320: URL: https://github.com/apache/trafficserver/pull/12320#discussion_r2178572948
########## doc/developer-guide/cripts/cripts-certs.en.rst: ########## @@ -0,0 +1,172 @@ +.. Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +.. include:: ../../common.defs + +.. highlight:: cpp +.. default-domain:: cpp + +.. _cripts-certs: + +Certificates +************ + +Cripts provides a set of convenient classes for introspection into the various +TLS certificates that are used. These includes both the server certificates used +to establish a TLS connections, as well as any client certificates used for +mutual TLS. + +In the current implementation, these objects only work on X509 certificates as +associated with the ``client`` and ``server`` connections. Let's start off with +a simple example of how to use these objects: + +.. code-block:: cpp + + do_send_response() + { + if (client.connection.IsTLS()) { + const auto tls = cripts::Certs::Server(client.connection); + + client.response["X-Subject"] = tls.subject; + client.response["X-NotBefore"] = tls.notBefore; + client.response["X-NotAfter"] = tls.notAfter; + } + } + +.. _cripts-certs-objects: + +Objects +======= + +There are two types of objects for the certificates: + +================================= =============================================================== +Object Description +================================= =============================================================== +``cripts::Certs::Server`` The certificate used on the connection for TLS handshakes. +``cripts::Certs::Client`` The mutual TLS (mTLS) certificate used on the connection. Review Comment: Just to make sure I'm reading this right, is `Server` always used for client-side connections, and `Client` always used for server/origin-side connections? If so, let's make that explicit in the description. ########## doc/developer-guide/cripts/cripts-certs.en.rst: ########## @@ -0,0 +1,172 @@ +.. Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + +.. include:: ../../common.defs + +.. highlight:: cpp +.. default-domain:: cpp + +.. _cripts-certs: + +Certificates +************ + +Cripts provides a set of convenient classes for introspection into the various +TLS certificates that are used. These includes both the server certificates used Review Comment: One of these: * `These includes` -> `These include` * `These includes` -> `This includes` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
