8296229: JFR: jfr tool should print unsigned values correctly

Reviewed-by: coffeys, mgronlun
This commit is contained in:
Erik Gahlin 2022-11-11 14:55:41 +00:00
parent e7c2a8e60e
commit 87b809a2cb
15 changed files with 77 additions and 41 deletions

View file

@ -1146,15 +1146,16 @@ final class Finished {
private static void recordEvent(SSLSessionImpl session) {
TLSHandshakeEvent event = new TLSHandshakeEvent();
if (event.shouldCommit() || EventHelper.isLoggingSecurity()) {
int peerCertificateId = 0;
int hash = 0;
try {
// use hash code for Id
peerCertificateId = session
hash = session
.getCertificateChain()[0]
.hashCode();
} catch (SSLPeerUnverifiedException e) {
// not verified msg
}
long peerCertificateId = Integer.toUnsignedLong(hash);
if (event.shouldCommit()) {
event.peerHost = session.getPeerHost();
event.peerPort = session.getPeerPort();