amattioc / SDMX

SDMX Connectors
European Union Public License 1.2
85 stars 46 forks source link

INSEE queries fail #131

Closed amattioc closed 7 years ago

amattioc commented 7 years ago

HTTP error 301...

eblondel commented 7 years ago

FYI, the new endpoint: https://bdm.insee.fr/series/sdmx Hope this helps..

amattioc commented 7 years ago

Hi @eblondel, thanks for the hint

charphi commented 7 years ago

Http errors 301 and 302 are redirections. You just need to parse response headers to get the new url. This is done automatically by the browsers but strangely not by HttpURLConnection. (see https://www.mkyong.com/java/java-httpurlconnection-follow-redirect-example/)

It could be interesting to support redirection in conjunction with a manual update of the url so that the library can be more resilient to change.

amattioc commented 7 years ago

Hi @charphi I totally agree, we are already working on this.

eblondel commented 7 years ago

@amattioc to complement, here the info shared by some rsdmx user: https://www.insee.fr/fr/information/2846583 about recent SDMX changes in INSEE

amattioc commented 7 years ago

The endpoint has been updated, and the 'follow redirect' mechanism has been added (0fc85bc8965b5c96b0138f440e712d2e1844dcb7).

INSEE now uses https but unfortunately the CA is not recognized by the JVM, so it is necessary to add the certificate to the keystore for using the provider.

Alternatively it is possible to set the ssl.disable.cert.check parameter to true in the configuration file or, since this provider also responds in HTTP, to manually add it as a custom provider (using the addProvider function). Of course both options will lower the security of the connection.

charphi commented 7 years ago

I have no problem with Java 1.8.0_111. It seems that the latest JVM contains the right CAs.

Edit: I've just got an error with CA. I tried again and it was gone !? So, there might be a problem on the server side.

Edit2: @amattioc : you are right, it doesn't work with the current JVM (my specific network config hides this problem).

amattioc commented 7 years ago

With 1.6/1.7 I never saw it working...