| 111 | } |
| 112 | |
| 113 | bool |
| 114 | ServerSessionPool::validate_sni(HttpSM *sm, NetVConnection *netvc) |
| 115 | { |
| 116 | bool retval = true; |
| 117 | // Verify that the sni name on this connection would match the sni we would have use to create |
| 118 | // a new connection. |
| 119 | // |
| 120 | if (sm->t_state.scheme == URL_WKSIDX_HTTPS) { |
| 121 | if (auto snis = netvc->get_service<TLSSNISupport>(); snis) { |
| 122 | const char *session_sni = snis->get_sni_server_name(); |
| 123 | std::string_view proposed_sni = sm->get_outbound_sni(); |
| 124 | Dbg(dbg_ctl_http_ss, "validate_sni proposed_sni=%.*s, sni=%s", static_cast<int>(proposed_sni.length()), proposed_sni.data(), |
| 125 | session_sni); |
| 126 | if (!session_sni || session_sni[0] == '\0' || proposed_sni.length() == 0) { |
| 127 | retval = session_sni == nullptr && proposed_sni.length() == 0; |
| 128 | } else { |
| 129 | retval = proposed_sni.compare(session_sni) == 0; |
| 130 | } |
| 131 | } else { |
| 132 | retval = false; |
| 133 | } |
| 134 | } |
| 135 | return retval; |
| 136 | } |
| 137 | |
| 138 | bool |
| 139 | ServerSessionPool::validate_cert(HttpSM *sm, NetVConnection *netvc) |
nothing calls this directly
no test coverage detected