GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
I do not connect to the Geonames API  XML
Forum Index -> General
Author Message
levanthai



Joined: 25/09/2018 09:48:54
Messages: 2
Offline

Hello:

More than a year ago I made a code that uses the Geonames web services. At the time it worked very well, but now it does not connect to the Geonames API.

Generating the following error:

dic 11, 2017 7:22:03 PM org.geonames.WebServiceMy tryFailoverServer
ADVERTENCIA: problems connecting to geonames server https://api.geonames.org
javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No name matching api.geonames.org found
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1917)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:301)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:295)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1369)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:156)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:925)
at sun.security.ssl.Handshaker.process_record(Handshaker.java:860)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1043)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1343)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1371)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1355)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1511)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1439)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
at org.geonames.WebServiceMy.connect(WebServiceMy.java:230)
at org.geonames.WebServiceMy.connectAndParse(WebServiceMy.java:297)
at org.geonames.WebServiceMy.wikipediaSearchInBoundingBox(WebServiceMy.java:150
at DataSourceWikipedia.wikipediaSearchInBoundingBox(DataSourceWikipedia.java:62)
at DataSourceWikipedia.ToEnrich(DataSourceWikipedia.java:71)
at Principal.main(Principal.java:126)
Caused by: java.security.cert.CertificateException: No name matching api.geonames.org found
at sun.security.util.HostnameChecker.matchDNS(HostnameChecker.java:20
at sun.security.util.HostnameChecker.match(HostnameChecker.java:93)
at sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:455)
at sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:436)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:200)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1351)
... 18 more

javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No name matching api.geonames.org found
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1917)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:301)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:295)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1369)
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:156)
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:925)
at sun.security.ssl.Handshaker.process_record(Handshaker.java:860)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1043)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1343)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1371)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1355)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:563)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1511)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1439)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
at org.geonames.WebServiceMy.connect(WebServiceMy.java:230)
at org.geonames.WebServiceMy.connectAndParse(WebServiceMy.java:297)
at org.geonames.WebServiceMy.wikipediaSearchInBoundingBox(WebServiceMy.java:150
at DataSourceWikipedia.wikipediaSearchInBoundingBox(DataSourceWikipedia.java:62)
at DataSourceWikipedia.ToEnrich(DataSourceWikipedia.java:71)
at Principal.main(Principal.java:126)
Caused by: java.security.cert.CertificateException: No name matching api.geonames.org found
at sun.security.util.HostnameChecker.matchDNS(HostnameChecker.java:20
at sun.security.util.HostnameChecker.match(HostnameChecker.java:93)
at sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:455)
at sun.security.ssl.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:436)
at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:200)
at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1351)
... 18 more

Any idea of the problem?

Best regards Manuel Puebla.
marc



Joined: 08/12/2005 07:39:47
Messages: 4412
Offline

Hi Manuel

For a https connection you need the secure endpoint at secure.geonames.org

Not all api.geonames.org servers are yet configured for ssl. So you have to use the specific secure endpoint to use one of the enabled servers.

Best Regards

Marc

[WWW]
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team