Skip to content

Commit 852141b

Browse files
committed
8372004: Have SSLLogger implement System.Logger
Reviewed-by: dfuchs, weijun
1 parent 72c45a4 commit 852141b

File tree

80 files changed

+798
-797
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+798
-797
lines changed

src/java.base/share/classes/sun/security/ssl/Alert.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ public void consume(ConnectionContext context,
238238
TransportContext tc = (TransportContext)context;
239239

240240
AlertMessage am = new AlertMessage(tc, m);
241-
if (SSLLogger.isOn && SSLLogger.isOn("ssl")) {
241+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl")) {
242242
SSLLogger.fine("Received alert message", am);
243243
}
244244

src/java.base/share/classes/sun/security/ssl/AlpnExtension.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public byte[] produce(ConnectionContext context,
157157

158158
// Is it a supported and enabled extension?
159159
if (!chc.sslConfig.isAvailable(SSLExtension.CH_ALPN)) {
160-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
160+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
161161
SSLLogger.info(
162162
"Ignore client unavailable extension: " +
163163
SSLExtension.CH_ALPN.name);
@@ -170,7 +170,7 @@ public byte[] produce(ConnectionContext context,
170170

171171
String[] laps = chc.sslConfig.applicationProtocols;
172172
if ((laps == null) || (laps.length == 0)) {
173-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
173+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
174174
SSLLogger.info(
175175
"No available application protocols");
176176
}
@@ -183,7 +183,7 @@ public byte[] produce(ConnectionContext context,
183183
int length = ap.getBytes(alpnCharset).length;
184184
if (length == 0) {
185185
// log the configuration problem
186-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
186+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
187187
SSLLogger.severe(
188188
"Application protocol name cannot be empty");
189189
}
@@ -197,7 +197,7 @@ public byte[] produce(ConnectionContext context,
197197
listLength += (length + 1);
198198
} else {
199199
// log the configuration problem
200-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
200+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
201201
SSLLogger.severe(
202202
"Application protocol name (" + ap +
203203
") exceeds the size limit (" +
@@ -212,7 +212,7 @@ public byte[] produce(ConnectionContext context,
212212

213213
if (listLength > MAX_AP_LIST_LENGTH) {
214214
// log the configuration problem
215-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
215+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
216216
SSLLogger.severe(
217217
"The configured application protocols (" +
218218
Arrays.toString(laps) +
@@ -266,7 +266,7 @@ public void consume(ConnectionContext context,
266266
if (!shc.sslConfig.isAvailable(SSLExtension.CH_ALPN)) {
267267
shc.applicationProtocol = "";
268268
shc.conContext.applicationProtocol = "";
269-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
269+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
270270
SSLLogger.info(
271271
"Ignore server unavailable extension: " +
272272
SSLExtension.CH_ALPN.name);
@@ -288,7 +288,7 @@ public void consume(ConnectionContext context,
288288
if (noAPSelector && noAlpnProtocols) {
289289
shc.applicationProtocol = "";
290290
shc.conContext.applicationProtocol = "";
291-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
291+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
292292
SSLLogger.fine(
293293
"Ignore server unenabled extension: " +
294294
SSLExtension.CH_ALPN.name);
@@ -378,7 +378,7 @@ public byte[] produce(ConnectionContext context,
378378
(AlpnSpec)shc.handshakeExtensions.get(SSLExtension.CH_ALPN);
379379
if (requestedAlps == null) {
380380
// Ignore, this extension was not requested and accepted.
381-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
381+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
382382
SSLLogger.fine(
383383
"Ignore unavailable extension: " +
384384
SSLExtension.SH_ALPN.name);
@@ -423,7 +423,7 @@ public byte[] produce(ConnectionContext context,
423423
// Ignore, no negotiated application layer protocol.
424424
shc.applicationProtocol = "";
425425
shc.conContext.applicationProtocol = "";
426-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
426+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
427427
SSLLogger.warning(
428428
"Ignore, no negotiated application layer protocol");
429429
}

src/java.base/share/classes/sun/security/ssl/CertSignAlgsExtension.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public byte[] produce(ConnectionContext context,
9494
// Is it a supported and enabled extension?
9595
if (!chc.sslConfig.isAvailable(
9696
SSLExtension.CH_SIGNATURE_ALGORITHMS_CERT)) {
97-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
97+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
9898
SSLLogger.fine(
9999
"Ignore unavailable " +
100100
"signature_algorithms_cert extension");
@@ -144,7 +144,7 @@ public void consume(ConnectionContext context,
144144
// Is it a supported and enabled extension?
145145
if (!shc.sslConfig.isAvailable(
146146
SSLExtension.CH_SIGNATURE_ALGORITHMS_CERT)) {
147-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
147+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
148148
SSLLogger.fine(
149149
"Ignore unavailable " +
150150
"signature_algorithms_cert extension");
@@ -235,7 +235,7 @@ public byte[] produce(ConnectionContext context,
235235
// Is it a supported and enabled extension?
236236
if (!shc.sslConfig.isAvailable(
237237
SSLExtension.CH_SIGNATURE_ALGORITHMS_CERT)) {
238-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
238+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
239239
SSLLogger.fine(
240240
"Ignore unavailable " +
241241
"signature_algorithms_cert extension");
@@ -283,7 +283,7 @@ public void consume(ConnectionContext context,
283283
// Is it a supported and enabled extension?
284284
if (!chc.sslConfig.isAvailable(
285285
SSLExtension.CH_SIGNATURE_ALGORITHMS_CERT)) {
286-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
286+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
287287
SSLLogger.fine(
288288
"Ignore unavailable " +
289289
"signature_algorithms_cert extension");

src/java.base/share/classes/sun/security/ssl/CertStatusExtension.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ private CertStatusRequestSpec(HandshakeContext hc,
144144
if (statusType == CertStatusRequestType.OCSP.id) {
145145
this.statusRequest = new OCSPStatusRequest(statusType, encoded);
146146
} else {
147-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
147+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
148148
SSLLogger.info(
149149
"Unknown certificate status request " +
150150
"(status type: " + statusType + ")");
@@ -196,7 +196,7 @@ private CertStatusResponseSpec(HandshakeContext hc,
196196
if (type == CertStatusRequestType.OCSP.id) {
197197
this.statusResponse = new OCSPStatusResponse(type, respData);
198198
} else {
199-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
199+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
200200
SSLLogger.info(
201201
"Unknown certificate status response " +
202202
"(status type: " + type + ")");
@@ -557,7 +557,7 @@ public byte[] produce(ConnectionContext context,
557557
}
558558

559559
if (!chc.sslConfig.isAvailable(SSLExtension.CH_STATUS_REQUEST)) {
560-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
560+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
561561
SSLLogger.fine(
562562
"Ignore unavailable extension: " +
563563
SSLExtension.CH_STATUS_REQUEST.name);
@@ -598,7 +598,7 @@ public void consume(ConnectionContext context,
598598
ServerHandshakeContext shc = (ServerHandshakeContext)context;
599599

600600
if (!shc.sslConfig.isAvailable(SSLExtension.CH_STATUS_REQUEST)) {
601-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
601+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
602602
SSLLogger.fine("Ignore unavailable extension: " +
603603
SSLExtension.CH_STATUS_REQUEST.name);
604604
}
@@ -656,7 +656,7 @@ public byte[] produce(ConnectionContext context,
656656
shc.handshakeExtensions.get(SSLExtension.CH_STATUS_REQUEST);
657657
if (spec == null) {
658658
// Ignore, no status_request extension requested.
659-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
659+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
660660
SSLLogger.finest("Ignore unavailable extension: " +
661661
SSLExtension.CH_STATUS_REQUEST.name);
662662
}
@@ -666,7 +666,7 @@ public byte[] produce(ConnectionContext context,
666666

667667
// Is it a session resuming?
668668
if (shc.isResumption) {
669-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
669+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
670670
SSLLogger.finest(
671671
"No status_request response for session resuming");
672672
}
@@ -839,7 +839,7 @@ private CertStatusRequestV2Spec(HandshakeContext hc,
839839
statusRequests.add(
840840
new OCSPStatusRequest(statusType, encoded));
841841
} else {
842-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
842+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
843843
SSLLogger.info(
844844
"Unknown certificate status request " +
845845
"(status type: " + statusType + ")");
@@ -915,7 +915,7 @@ public byte[] produce(ConnectionContext context,
915915
}
916916

917917
if (!chc.sslConfig.isAvailable(SSLExtension.CH_STATUS_REQUEST_V2)) {
918-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
918+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
919919
SSLLogger.finest(
920920
"Ignore unavailable status_request_v2 extension");
921921
}
@@ -957,7 +957,7 @@ public void consume(ConnectionContext context,
957957
ServerHandshakeContext shc = (ServerHandshakeContext)context;
958958

959959
if (!shc.sslConfig.isAvailable(SSLExtension.CH_STATUS_REQUEST_V2)) {
960-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
960+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
961961
SSLLogger.finest(
962962
"Ignore unavailable status_request_v2 extension");
963963
}
@@ -1017,7 +1017,7 @@ public byte[] produce(ConnectionContext context,
10171017
shc.handshakeExtensions.get(SSLExtension.CH_STATUS_REQUEST_V2);
10181018
if (spec == null) {
10191019
// Ignore, no status_request_v2 extension requested.
1020-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
1020+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
10211021
SSLLogger.finest(
10221022
"Ignore unavailable status_request_v2 extension");
10231023
}
@@ -1027,7 +1027,7 @@ public byte[] produce(ConnectionContext context,
10271027

10281028
// Is it a session resuming?
10291029
if (shc.isResumption) {
1030-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
1030+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
10311031
SSLLogger.finest(
10321032
"No status_request_v2 response for session resumption");
10331033
}
@@ -1112,7 +1112,7 @@ public byte[] produce(ConnectionContext context,
11121112

11131113
// Stapling needs to be active and have valid data to proceed
11141114
if (shc.stapleParams == null) {
1115-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
1115+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
11161116
SSLLogger.finest(
11171117
"Stapling is disabled for this connection");
11181118
}
@@ -1121,7 +1121,7 @@ public byte[] produce(ConnectionContext context,
11211121

11221122
// There needs to be a non-null CertificateEntry to proceed
11231123
if (shc.currentCertEntry == null) {
1124-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
1124+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
11251125
SSLLogger.finest("Found null CertificateEntry in context");
11261126
}
11271127
return null;
@@ -1139,7 +1139,7 @@ public byte[] produce(ConnectionContext context,
11391139
byte[] respBytes = shc.stapleParams.responseMap.get(x509Cert);
11401140
if (respBytes == null) {
11411141
// We're done with this entry. Clear it from the context
1142-
if (SSLLogger.isOn &&
1142+
if (SSLLogger.isOn() &&
11431143
SSLLogger.isOn("ssl,handshake,verbose")) {
11441144
SSLLogger.finest("No status response found for " +
11451145
x509Cert.getSubjectX500Principal());
@@ -1149,7 +1149,7 @@ public byte[] produce(ConnectionContext context,
11491149
}
11501150

11511151
// Build a proper response buffer from the stapling information
1152-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake,verbose")) {
1152+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake,verbose")) {
11531153
SSLLogger.finest("Found status response for " +
11541154
x509Cert.getSubjectX500Principal() +
11551155
", response length: " + respBytes.length);
@@ -1208,7 +1208,7 @@ public void consume(ConnectionContext context,
12081208
respList.add(spec.statusResponse.encodedResponse);
12091209
chc.handshakeSession.setStatusResponses(respList);
12101210
} else {
1211-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake,verbose")) {
1211+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake,verbose")) {
12121212
SSLLogger.finest(
12131213
"Ignoring stapled data on resumed session");
12141214
}

src/java.base/share/classes/sun/security/ssl/CertificateAuthoritiesExtension.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public byte[] produce(ConnectionContext context,
192192
// Is it a supported and enabled extension?
193193
if (!chc.sslConfig.isAvailable(
194194
SSLExtension.CH_CERTIFICATE_AUTHORITIES)) {
195-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
195+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
196196
SSLLogger.fine(
197197
"Ignore unavailable " +
198198
"certificate_authorities extension");
@@ -205,7 +205,7 @@ public byte[] produce(ConnectionContext context,
205205
X509Certificate[] caCerts =
206206
chc.sslContext.getX509TrustManager().getAcceptedIssuers();
207207
if (caCerts.length == 0) {
208-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
208+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
209209
SSLLogger.fine(
210210
"No available certificate authorities");
211211
}
@@ -216,7 +216,7 @@ public byte[] produce(ConnectionContext context,
216216
List<byte[]> encodedCAs =
217217
CertificateAuthoritiesSpec.getEncodedAuthorities(caCerts);
218218
if (encodedCAs.isEmpty()) {
219-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
219+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
220220
SSLLogger.warning(
221221
"The number of CAs exceeds the maximum size " +
222222
"of the certificate_authorities extension");
@@ -270,7 +270,7 @@ public void consume(ConnectionContext context,
270270
// Is it a supported and enabled extension?
271271
if (!shc.sslConfig.isAvailable(
272272
SSLExtension.CH_CERTIFICATE_AUTHORITIES)) {
273-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
273+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
274274
SSLLogger.fine(
275275
"Ignore unavailable " +
276276
"certificate_authorities extension");
@@ -319,7 +319,7 @@ public byte[] produce(ConnectionContext context,
319319
// Is it a supported and enabled extension?
320320
if (!shc.sslConfig.isAvailable(
321321
SSLExtension.CR_CERTIFICATE_AUTHORITIES)) {
322-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
322+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
323323
SSLLogger.fine(
324324
"Ignore unavailable " +
325325
"certificate_authorities extension");
@@ -332,7 +332,7 @@ public byte[] produce(ConnectionContext context,
332332
X509Certificate[] caCerts =
333333
shc.sslContext.getX509TrustManager().getAcceptedIssuers();
334334
if (caCerts.length == 0) {
335-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
335+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
336336
SSLLogger.fine(
337337
"No available certificate authorities");
338338
}
@@ -343,7 +343,7 @@ public byte[] produce(ConnectionContext context,
343343
List<byte[]> encodedCAs =
344344
CertificateAuthoritiesSpec.getEncodedAuthorities(caCerts);
345345
if (encodedCAs.isEmpty()) {
346-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
346+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
347347
SSLLogger.warning(
348348
"Too many certificate authorities to use " +
349349
"the certificate_authorities extension");
@@ -397,7 +397,7 @@ public void consume(ConnectionContext context,
397397
// Is it a supported and enabled extension?
398398
if (!chc.sslConfig.isAvailable(
399399
SSLExtension.CR_CERTIFICATE_AUTHORITIES)) {
400-
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
400+
if (SSLLogger.isOn() && SSLLogger.isOn("ssl,handshake")) {
401401
SSLLogger.fine(
402402
"Ignore unavailable " +
403403
"certificate_authorities extension");

0 commit comments

Comments
 (0)