ldaps authentication CN validation fails when using alias providerUrl

while using alias name for providerUrl, CN hostname verification throws exception.
providerUrl="ldaps://ldap.mycompany.com"
and CN resolves to linuxldap1.mycompany.com then it throws exception.