|
27 | 27 | import java.util.function.LongConsumer; |
28 | 28 | import java.util.function.Predicate; |
29 | 29 | import java.util.stream.Collectors; |
30 | | -import javax.net.ssl.SSLParameters; |
31 | 30 | import javax.net.ssl.X509TrustManager; |
32 | 31 | import org.slf4j.Logger; |
33 | 32 | import org.slf4j.LoggerFactory; |
@@ -216,72 +215,6 @@ public X509Certificate[] getAcceptedIssuers() { |
216 | 215 | } |
217 | 216 | } |
218 | 217 |
|
219 | | - static void mergeSslParameters(SSLParameters original, SSLParameters provided) { |
220 | | - if (notEmptyArray(provided.getCipherSuites())) { |
221 | | - LOGGER.debug( |
222 | | - "Setting SSLParameters cipherSuites from {} to {}", |
223 | | - arrayToString(original.getCipherSuites()), |
224 | | - arrayToString(provided.getCipherSuites())); |
225 | | - original.setCipherSuites(provided.getCipherSuites()); |
226 | | - } |
227 | | - if (notEmptyArray(provided.getProtocols())) { |
228 | | - LOGGER.debug( |
229 | | - "Setting SSLParameters protocols from {} to {}", |
230 | | - arrayToString(original.getProtocols()), |
231 | | - arrayToString(provided.getProtocols())); |
232 | | - original.setProtocols(provided.getProtocols()); |
233 | | - } |
234 | | - if (original.getWantClientAuth() != provided.getWantClientAuth()) { |
235 | | - LOGGER.debug( |
236 | | - "Setting SSLParameters wantClientAuth from {} to {}", |
237 | | - original.getWantClientAuth(), |
238 | | - provided.getWantClientAuth()); |
239 | | - original.setWantClientAuth(provided.getWantClientAuth()); |
240 | | - } |
241 | | - if (original.getNeedClientAuth() != provided.getNeedClientAuth()) { |
242 | | - LOGGER.debug( |
243 | | - "Setting SSLParameters needClientAuth from {} to {}", |
244 | | - original.getNeedClientAuth(), |
245 | | - provided.getNeedClientAuth()); |
246 | | - original.setNeedClientAuth(provided.getNeedClientAuth()); |
247 | | - } |
248 | | - if (notNullOrBlank(provided.getEndpointIdentificationAlgorithm())) { |
249 | | - LOGGER.debug( |
250 | | - "Setting SSLParameters endpointIdentificationAlgorithm from {} to {}", |
251 | | - original.getEndpointIdentificationAlgorithm(), |
252 | | - provided.getEndpointIdentificationAlgorithm()); |
253 | | - original.setEndpointIdentificationAlgorithm(provided.getEndpointIdentificationAlgorithm()); |
254 | | - } |
255 | | - if (provided.getAlgorithmConstraints() != null) { |
256 | | - LOGGER.debug( |
257 | | - "Setting SSLParameters algorithmConstraints from {} to {}", |
258 | | - original.getAlgorithmConstraints(), |
259 | | - provided.getAlgorithmConstraints()); |
260 | | - original.setAlgorithmConstraints(provided.getAlgorithmConstraints()); |
261 | | - } |
262 | | - if (provided.getServerNames() != null) { |
263 | | - LOGGER.debug( |
264 | | - "Setting SSLParameters serverNames from {} to {}", |
265 | | - original.getServerNames(), |
266 | | - provided.getServerNames()); |
267 | | - original.setServerNames(provided.getServerNames()); |
268 | | - } |
269 | | - if (provided.getSNIMatchers() != null) { |
270 | | - LOGGER.debug( |
271 | | - "Setting SSLParameters SNIMatchers from {} to {}", |
272 | | - original.getSNIMatchers(), |
273 | | - provided.getSNIMatchers()); |
274 | | - original.setSNIMatchers(provided.getSNIMatchers()); |
275 | | - } |
276 | | - if (original.getUseCipherSuitesOrder() != provided.getUseCipherSuitesOrder()) { |
277 | | - LOGGER.debug( |
278 | | - "Setting SSLParameters useCipherSuitesOrder from {} to {}", |
279 | | - original.getUseCipherSuitesOrder(), |
280 | | - provided.getUseCipherSuitesOrder()); |
281 | | - original.setUseCipherSuitesOrder(provided.getUseCipherSuitesOrder()); |
282 | | - } |
283 | | - } |
284 | | - |
285 | 218 | private static boolean notNullOrBlank(String str) { |
286 | 219 | return str != null && !str.trim().isEmpty(); |
287 | 220 | } |
|
0 commit comments