bneradt commented on code in PR #13711: URL: https://github.com/apache/trafficserver/pull/13711#discussion_r4075060671
########## tests/gold_tests/tls/tls_origin_session_reuse_large.test.py: ########## @@ -0,0 +1,143 @@ +# 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. + +Test.Summary = ''' +Origin TLS sessions must still be cached when the serialized session is large. + +The origin session cache refuses to store a session whose i2d_SSL_SESSION form +exceeds SSL_MAX_ORIG_SESSION_SIZE. A serialized session carries the peer +certificate and the session ticket, so an origin with a large certificate -- or +any mutual-TLS origin, whose ticket encodes the client certificate -- produces a +session that trips that limit and is silently dropped, costing a full handshake +on every connection. +''' + +# ts_origin presents a deliberately large certificate (120 SANs, 4328 bytes DER), +# so the session ts_proxy caches for it does not fit in a small fixed buffer. +ts_origin = Test.MakeATSProcess("ts_origin", enable_tls=True) +ts_proxy = Test.MakeATSProcess("ts_proxy", enable_tls=True) +server = Test.MakeOriginServer("server") + +request_header = {"headers": "GET / HTTP/1.1\r\nHost: www.example.com\r\n\r\n", "timestamp": "1469733493.993", "body": ""} +response_header = { + "headers": "HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n", + "timestamp": "1469733493.993", + "body": "large session test" +} +server.addResponse("sessionlog.json", request_header, response_header) + +ts_origin.addSSLfile("ssl/server-large.pem") +ts_origin.addSSLfile("ssl/server-large.key") +ts_proxy.addSSLfile("ssl/server.pem") +ts_proxy.addSSLfile("ssl/server.key") + Review Comment: As codex says, organizing as a Test class would be preferable. See the `tests/gold_tests/ats_probe/ats_probe.test.py` as an example. -- 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]
