You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2021/02/24 04:44:58 UTC

[GitHub] [trafficserver] maskit commented on a change in pull request #7552: Use SSL_CTX address as part of the lookup key

maskit commented on a change in pull request #7552:
URL: https://github.com/apache/trafficserver/pull/7552#discussion_r581619998



##########
File path: iocore/net/SSLClientUtils.cc
##########
@@ -159,32 +159,21 @@ ssl_client_cert_callback(SSL *ssl, void * /*arg*/)
 static int
 ssl_new_session_callback(SSL *ssl, SSL_SESSION *sess)
 {
-  const char *tlsext_host_name = SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name);
-  if (tlsext_host_name) {
-    std::string sni(tlsext_host_name);
-    origin_sess_cache->insert_session(sni, sess);
+  std::string sni_addr = get_sni_addr(ssl);
+  if (!sni_addr.empty()) {
+    SSL_CTX *ctx = SSL_get_SSL_CTX(ssl);
+    std::stringstream ctx_ss;
+    ctx_ss << static_cast<const void *>(ctx);
+    std::string lookup_key;
+    ts::bwprint(lookup_key, "{}:{}", sni_addr.c_str(), ctx_ss.str().c_str());

Review comment:
       We can't do `%p` with bwprint?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org