From where does the “Contains non-LDH ASCII characters” exception come from?

↘锁芯ラ 提交于 2021-01-27 20:43:25

问题


I develop an application (spring-magnolia) that around this new year (2018) started to throw for me this exception but not for any other colleagues.

The exception is right, there is an _ in the a configured host name, so that domain name should be fixed. Still, it was working before and for the other folks it is still working, not throwing this exception. I tried many different things, from tomcat settings to using an older JRE (1.7)... and even switched from Ubuntu to Windows but the exception wasn't left behind.

One of my mates is working with me in the office, using Mac, and I could look up his settings to catch what is making this difference, but don't really know what else should I look up as the tools, environment are the same (maven, same code, tried different jdks).

Could someone give me a clue what triggered the exception for me but not for others and if I could set it somewhere to ignore this exception?

Caused by: java.security.cert.CertificateException: Illegal given domain name: xyz_t-bud.rd-services.com
    at sun.security.util.HostnameChecker.matchDNS(Unknown Source)
    at sun.security.util.HostnameChecker.match(Unknown Source)
    at sun.security.ssl.X509TrustManagerImpl.checkIdentity(Unknown Source)
    at sun.security.ssl.X509TrustManagerImpl.checkIdentity(Unknown Source)
    at sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
    at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
    ... 135 more
Caused by: java.lang.IllegalArgumentException: Contains non-LDH ASCII characters
    at java.net.IDN.toASCIIInternal(Unknown Source)
    at java.net.IDN.toASCII(Unknown Source)
    at javax.net.ssl.SNIHostName.<init>(Unknown Source)
    ... 141 more

回答1:


Apparently I wasn't testing with older JDKs, as eclipse wasn't picking it up. After uninstalling the latest JDK 1.8.0_161and installing the JDK that my colleague is having, that is 1.8.0_111 I am no longer getting this error... I did try this JDK before, but I didn't uninstall the latest JDK and so the project was in fact still using the latest JDK...



来源:https://stackoverflow.com/questions/49314445/from-where-does-the-contains-non-ldh-ascii-characters-exception-come-from

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!