IDV icon indicating copy to clipboard operation
IDV copied to clipboard

HTTP to HTTPS

Open julienchastang opened this issue 8 years ago • 5 comments

Related to #128. There are many references in the IDV that point to obsolete http URLs. Migrate to https. Document what needs to be updated in this issue.

  • #128
  • https://www.unidata.ucar.edu/georesources/*

julienchastang avatar Nov 27 '17 22:11 julienchastang

If possible, it would be best to take the time to make sure whatever code is making the http requests checked the server response to see if there was a http redirect, and if so, checked the location returned in the server response to find the the new location of the resource.

lesserwhirls avatar Nov 27 '17 23:11 lesserwhirls

Luckily most of not all of the url access in the IDV goes through a single method IOUtil.getInputStream so making this change shouldn’t be too hard

Jeff

On Mon, Nov 27, 2017 at 4:26 PM Sean Arms [email protected] wrote:

If possible, it would be best to take the time to make sure whatever code is making the http requests checked the server response to see if there was a http redirect, and if so, checked the location returned in the server response to find the the new location of the resource.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Unidata/IDV/issues/129#issuecomment-347363217, or mute the thread https://github.com/notifications/unsubscribe-auth/ABonTz8Oy4noqU-ZdssuSbF9Zvdb0GGrks5s60UXgaJpZM4QsZKK .

jeffmcwhirter avatar Nov 27 '17 23:11 jeffmcwhirter

Awhile back I basically did what Sean and Jeff proposed for McV, though we had to back out of the change for a few reasons (that escape me at the moment). Here's what I had:

https://github.com/Unidata/IDV/compare/master...jon4than:http-redirects?expand=1

I can create a pull request if you'd like.

jon4than avatar Nov 29 '17 00:11 jon4than

Jon,

Please create a pull request. Your solution is better.

Yuan

On Tue, Nov 28, 2017 at 5:40 PM, Jonathan Beavers [email protected] wrote:

Awhile back I basically did what Sean and Jeff proposed for McV, though we had to back out of the change for a few reasons (that escape me at the moment). Here's what I had:

https://github.com/Unidata/IDV/compare/master...jon4than: http-redirects?expand=1

I can create a pull request if you'd like.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Unidata/IDV/issues/129#issuecomment-347713317, or mute the thread https://github.com/notifications/unsubscribe-auth/ABI4rzhd5I7P_fc2LTSUJ6H4MM5HpIRgks5s7KgMgaJpZM4QsZKK .

yuanho avatar Nov 29 '17 03:11 yuanho

I'm not sure who all did what but I made a change to IOUtil just now (so I could load some bundles for some drilsdown work) before I saw that its been changed. I'm checking my changes in and overriding the other changes as it seems like just swapping out http for https might not be an effective way to handle redirects as there might be server and/or path changes as well.

Below is the diff

-Jeff

                int response = huc.getResponseCode();
                //Check for redirect
                if (response == HttpURLConnection.HTTP_MOVED_TEMP
                    || response == HttpURLConnection.HTTP_MOVED_PERM
                    || response == HttpURLConnection.HTTP_SEE_OTHER) {
                    String newUrl =

connection.getHeaderField("Location");

                    connection = new URL(newUrl).openConnection();
                    connection.setAllowUserInteraction(true);
                    huc = (HttpURLConnection) connection;
                }

1297,1301d1306 < } else if (huc.getResponseCode() == 301 || huc.getResponseCode() == 302) { < String urlStr = url.toString().replaceFirst("http:", "https:"); < URL newURL = new URL(urlStr); < connection = newURL.openConnection(); < connection.setReadTimeout(30000); //30 sec

On Tue, Nov 28, 2017 at 8:06 PM, yuanho [email protected] wrote:

Jon,

Please create a pull request. Your solution is better.

Yuan

On Tue, Nov 28, 2017 at 5:40 PM, Jonathan Beavers < [email protected]> wrote:

Awhile back I basically did what Sean and Jeff proposed for McV, though we had to back out of the change for a few reasons (that escape me at the moment). Here's what I had:

https://github.com/Unidata/IDV/compare/master...jon4than: http-redirects?expand=1

I can create a pull request if you'd like.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Unidata/IDV/issues/129#issuecomment-347713317, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABI4rzhd5I7P_ fc2LTSUJ6H4MM5HpIRgks5s7KgMgaJpZM4QsZKK> .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Unidata/IDV/issues/129#issuecomment-347738731, or mute the thread https://github.com/notifications/unsubscribe-auth/ABonT7n7txxXnYBEpPRqRePR0G6-M42Qks5s7ModgaJpZM4QsZKK .

jeffmcwhirter avatar Nov 29 '17 04:11 jeffmcwhirter