Fix issue 2896: The server should return "Protocol Error" after a bind with a unrecognised version number
| | |
| | | # |
| | | # CDDL HEADER END |
| | | # |
| | | # Copyright 2006-2008 Sun Microsystems, Inc. |
| | | # Copyright 2006-2009 Sun Microsystems, Inc. |
| | | |
| | | |
| | | |
| | |
| | | SEVERE_ERR_CONNHANDLER_SSL_CANNOT_INITIALIZE_1504=An error occurred \ |
| | | while attempting to initialize the SSL context for use in the LDAP \ |
| | | Connection Handler: %s |
| | | MILD_ERR_LDAP_UNSUPPORTED_PROTOCOL_VERSION_1505=The Directory Server does not \ |
| | | support LDAP protocol version %d. This connection will be closed |
| | |
| | | versionString = "3"; |
| | | break; |
| | | default: |
| | | versionString = String.valueOf(ldapVersion); |
| | | break; |
| | | // Unsupported protocol version. RFC4511 states that we MUST send |
| | | // a protocol error back to the client. |
| | | BindResponseProtocolOp responseOp = |
| | | new BindResponseProtocolOp(LDAPResultCode.PROTOCOL_ERROR, |
| | | ERR_LDAP_UNSUPPORTED_PROTOCOL_VERSION.get(ldapVersion)); |
| | | sendLDAPMessage(new LDAPMessage(message.getMessageID(), |
| | | responseOp)); |
| | | disconnect(DisconnectReason.PROTOCOL_ERROR, false, |
| | | ERR_LDAP_UNSUPPORTED_PROTOCOL_VERSION.get(ldapVersion)); |
| | | return false; |
| | | } |
| | | |
| | | ByteString bindDN = protocolOp.getDN(); |