API Authentication and China

#1 - Jan. 3, 2012, 3:59 a.m.
Blizzard Post
I was working on trying to figure out what to urlencode and what not to for the authentication signature (more on this in another post) and I found this oddity.

I was doing secure authenticated requests on characters on Chinese realms (random selection from arenajunkies.com) and instead of getting an error 500 (see above about urlencoding), I was getting a Java SSL handshake exception.

On the battlenet.com.cn host:

https://battlenet.com.cn/api/wow/character/军团要塞/Vopott?fields=professions,guild
https://battlenet.com.cn/api/wow/character/纳克萨玛斯/神起苍穹?fields=professions,guild

The same goes for the cn.battle.net host:

https://cn.battle.net/api/wow/character/军团要塞/Vopott?fields=professions,guild
https://cn.battle.net/api/wow/character/纳克萨玛斯/神起苍穹?fields=professions,guild

Even Firefox doesn't like it. Unsecure requests:

http://battlenet.com.cn/api/wow/character/军团要塞/Vopott?fields=professions,guild
http://battlenet.com.cn/api/wow/character/纳克萨玛斯/神起苍穹?fields=professions,guild

do work. Did I hit the so-called Great Firewall of China?

Here is the stack trace:

Exception in thread "main" javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:174)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1623)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:198)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Handshaker.java:192)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1074)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:128)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Handshaker.java:529)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Handshaker.java:465)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:884)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1120)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1147)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1131)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:434)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:166)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:133)
at ca.forklabs.wow.net.ARealTest.main(ARealTest.java:46)
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:325)
at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:156)
at sun.security.validator.Validator.validate(Validator.java:218)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:126)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:209)
at com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:249)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1053)
... 11 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:174)
at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:238)
at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:320)
... 17 more
Forum Avatar
Battle.net Developer
#8 - April 19, 2012, 5:28 p.m.
Blizzard Post
The docs have been changed to list www.battlenet.com.cn as the host for china.