title: Unable to authenticate server certificate due to trailing spaces
body: <p>I've created a java spring-boot application that communicates with a server and sends it requests periodically. For security reasons i need to validate the certificates of the server, however there is a strange issue with the server's certificate. </p>
  
  <p>The name of the server in the list of Subject Alternative Names (SAN) contains a trailing space character. So the name of the server does not match any of the names in the certificate according to the code...</p>
  
  <p>For example if the URI is <code>"https://server-01.org/"</code> then the <code>SAN</code> of that server in the certificate is <code>"server-01.org "</code> which is a slight mismatch...</p>
  
  <p>Is there a way in java to ignore the trailing spaces in the certificate? I'm unable to change the server certificates, also other systems do not seem to trip over this issue. Is there a setting i can use in the java code?</p>