8325022: Incorrect error message on client authentication

Reviewed-by: jnimeh, hchao, djelinski
This commit is contained in:
John Jiang 2024-02-01 02:35:34 +00:00
parent 5b9b176c67
commit fe78c0f191

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -386,7 +386,7 @@ final class CertificateMessage {
ClientAuthType.CLIENT_AUTH_REQUESTED) { ClientAuthType.CLIENT_AUTH_REQUESTED) {
// unexpected or require client authentication // unexpected or require client authentication
throw shc.conContext.fatal(Alert.BAD_CERTIFICATE, throw shc.conContext.fatal(Alert.BAD_CERTIFICATE,
"Empty server certificate chain"); "Empty client certificate chain");
} else { } else {
return; return;
} }
@ -403,7 +403,7 @@ final class CertificateMessage {
} }
} catch (CertificateException ce) { } catch (CertificateException ce) {
throw shc.conContext.fatal(Alert.BAD_CERTIFICATE, throw shc.conContext.fatal(Alert.BAD_CERTIFICATE,
"Failed to parse server certificates", ce); "Failed to parse client certificates", ce);
} }
checkClientCerts(shc, x509Certs); checkClientCerts(shc, x509Certs);
@ -1224,7 +1224,7 @@ final class CertificateMessage {
} }
} catch (CertificateException ce) { } catch (CertificateException ce) {
throw shc.conContext.fatal(Alert.BAD_CERTIFICATE, throw shc.conContext.fatal(Alert.BAD_CERTIFICATE,
"Failed to parse server certificates", ce); "Failed to parse client certificates", ce);
} }
// find out the types of client authentication used // find out the types of client authentication used