fvaleri commented on code in PR #23005:
URL: https://github.com/apache/kafka/pull/23005#discussion_r3723152330
##########
clients/src/main/java/org/apache/kafka/common/security/oauthbearer/internals/secured/JaasOptionsUtils.java:
##########
@@ -85,10 +85,14 @@ public boolean shouldCreateSSLSocketFactory(URL url) {
public SSLSocketFactory createSSLSocketFactory() {
Map<String, ?> sslClientConfig = getSslClientConfig();
SslFactory sslFactory = new SslFactory(ConnectionMode.CLIENT);
- sslFactory.configure(sslClientConfig);
- SSLSocketFactory socketFactory = ((DefaultSslEngineFactory)
sslFactory.sslEngineFactory()).sslContext().getSocketFactory();
- log.debug("Created SSLSocketFactory: {}", sslClientConfig);
- return socketFactory;
+ try {
+ sslFactory.configure(sslClientConfig);
+ SSLSocketFactory socketFactory = ((DefaultSslEngineFactory)
sslFactory.sslEngineFactory()).sslContext().getSocketFactory();
+ log.debug("Created SSLSocketFactory: {}", sslClientConfig);
+ return socketFactory;
+ } finally {
+ sslFactory.close();
Review Comment:
Yes, a protective comment makes sense.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]