mirror of
https://github.com/google/nomulus
synced 2026-01-03 11:45:39 +00:00
Fix another bug in the proxy (#419)
The promise should be set outside the try block because if we want warning only, we still want the promise to be set even if the clientCertificate.checkValidity() throws an error.
This commit is contained in:
@@ -113,8 +113,6 @@ public class SslServerInitializer<C extends Channel> extends ChannelInitializer<
|
||||
sslHandler.engine().getSession().getPeerCertificates()[0];
|
||||
try {
|
||||
clientCertificate.checkValidity();
|
||||
Promise<X509Certificate> unusedPromise =
|
||||
clientCertificatePromise.setSuccess(clientCertificate);
|
||||
} catch (CertificateNotYetValidException | CertificateExpiredException e) {
|
||||
logger.atWarning().withCause(e).log(
|
||||
"Client certificate is not valid.\nHash: %s",
|
||||
@@ -123,8 +121,11 @@ public class SslServerInitializer<C extends Channel> extends ChannelInitializer<
|
||||
Promise<X509Certificate> unusedPromise =
|
||||
clientCertificatePromise.setFailure(e);
|
||||
ChannelFuture unusedFuture2 = channel.close();
|
||||
return;
|
||||
}
|
||||
}
|
||||
Promise<X509Certificate> unusedPromise =
|
||||
clientCertificatePromise.setSuccess(clientCertificate);
|
||||
} else {
|
||||
Promise<X509Certificate> unusedPromise =
|
||||
clientCertificatePromise.setFailure(future.cause());
|
||||
|
||||
Reference in New Issue
Block a user