Closed amattioc closed 7 years ago
FYI, the new endpoint: https://bdm.insee.fr/series/sdmx Hope this helps..
Hi @eblondel, thanks for the hint
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.
Hi @charphi I totally agree, we are already working on this.
@amattioc to complement, here the info shared by some rsdmx user: https://www.insee.fr/fr/information/2846583 about recent SDMX changes in INSEE
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.
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).
With 1.6/1.7 I never saw it working...
HTTP error 301...