|
24 | 24 |
|
25 | 25 | #include "SSLStats.h"
|
26 | 26 | #include "iocore/net/TLSBasicSupport.h"
|
| 27 | +#if defined(OPENSSL_IS_BORINGSSL) |
| 28 | +#include "tscore/Diags.h" // For Warning |
| 29 | +#endif // OPENSSL_IS_BORINGSSL |
27 | 30 | #include "tsutil/DbgCtl.h"
|
28 | 31 |
|
29 | 32 | #include <cinttypes>
|
@@ -201,3 +204,33 @@ TLSBasicSupport::_record_tls_handshake_end_time()
|
201 | 204 | Dbg(dbg_ctl_ssl, "ssl handshake time:%" PRId64, ssl_handshake_time);
|
202 | 205 | Metrics::Counter::increment(ssl_rsb.total_handshake_time, ssl_handshake_time);
|
203 | 206 | }
|
| 207 | + |
| 208 | +void |
| 209 | +TLSBasicSupport::_update_end_of_handshake_stats() |
| 210 | +{ |
| 211 | + Metrics::Counter::increment(ssl_rsb.total_success_handshake_count_in); |
| 212 | + |
| 213 | +#if defined(OPENSSL_IS_BORINGSSL) |
| 214 | + SSL *ssl = this->_get_ssl_object(); |
| 215 | + uint16_t group_id = SSL_get_group_id(ssl); |
| 216 | + if (group_id != 0) { |
| 217 | + const char *group_name = SSL_get_group_name(group_id); |
| 218 | + if (auto it = tls_group_map.find(group_name); it != tls_group_map.end()) { |
| 219 | + Metrics::Counter::increment(it->second); |
| 220 | + } else { |
| 221 | + Warning("Unknown TLS Group"); |
| 222 | + } |
| 223 | + } |
| 224 | +#elif defined(SSL_get_negotiated_group) |
| 225 | + SSL *ssl = this->_get_ssl_object(); |
| 226 | + int nid = SSL_get_negotiated_group(const_cast<SSL *>(ssl)); |
| 227 | + if (nid != NID_undef) { |
| 228 | + if (auto it = tls_group_map.find(nid); it != tls_group_map.end()) { |
| 229 | + Metrics::Counter::increment(it->second); |
| 230 | + } else { |
| 231 | + auto other = tls_group_map.find(SSL_GROUP_STAT_OTHER_KEY); |
| 232 | + Metrics::Counter::increment(other->second); |
| 233 | + } |
| 234 | + } |
| 235 | +#endif // OPENSSL_IS_BORINGSSL or SSL_get_negotiated_group |
| 236 | +} |
0 commit comments