bug 807435 telemetry for server TLS NPN support r=bsmith r=honzab

This commit is contained in:
Patrick McManus 2012-11-22 11:43:27 -05:00
parent db47e11909
commit 37f5399c50
2 changed files with 13 additions and 6 deletions

View File

@ -921,16 +921,18 @@ void HandshakeCallback(PRFileDesc* fd, void* client_data) {
status->mSecretKeyLength = encryptBits;
status->mCipherName.Assign(cipherName);
// Get the NPN value. Do this on the stack and copy it into
// a string rather than preallocating the string because right
// now we expect NPN to fail more often than it succeeds.
// Get the NPN value.
SSLNextProtoState state;
unsigned char npnbuf[256];
unsigned int npnlen;
if (SSL_GetNextProto(fd, &state, npnbuf, &npnlen, 256) == SECSuccess &&
state == SSL_NEXT_PROTO_NEGOTIATED)
infoObject->SetNegotiatedNPN(reinterpret_cast<char *>(npnbuf), npnlen);
if (SSL_GetNextProto(fd, &state, npnbuf, &npnlen, 256) == SECSuccess) {
if (state == SSL_NEXT_PROTO_NEGOTIATED)
infoObject->SetNegotiatedNPN(reinterpret_cast<char *>(npnbuf), npnlen);
else
infoObject->SetNegotiatedNPN(nullptr, 0);
mozilla::Telemetry::Accumulate(Telemetry::SSL_NPN_TYPE, state);
}
else
infoObject->SetNegotiatedNPN(nullptr, 0);

View File

@ -711,6 +711,11 @@
"n_values": 16,
"description": "SSL Version (0=ssl3, 1=tls1, 2=tls1.1, 3=tls1.2)"
},
"SSL_NPN_TYPE": {
"kind": "enumerated",
"n_values": 16,
"description": "NPN Results (0=none, 1=negotiated, 2=no-overlap)"
},
"WEBSOCKETS_HANDSHAKE_TYPE": {
"kind": "enumerated",
"n_values": 16,