mirror of
https://github.com/google/nomulus.git
synced 2025-07-19 17:26:09 +02: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:
parent
ffe3eb1548
commit
bfd61ef867
1 changed files with 3 additions and 2 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue