Closed tiborsimko closed 3 years ago
Another trouble with HTTPS protocol:
$ cernopendata-client download-files --recid 3005 --verify --protocol https --server https://opendata-dev.cern.ch
==> ERROR: Invalid value for --server: https://opendata-dev.cern.ch - Server should be a valid HTTP URI
I fixed it in #89 itself.
Thanks. One thing that remains is what to do when users specify --protocol https
but --server http://...
. The current behaviour is:
$ cernopendata-client get-file-locations --recid 3005 --protocol https --server http://opendata-dev.cern.ch
https://opendata.cern.ch/eos/opendata/cms/configuration-files/2011/0d0714743f0204ed3c0144941e6ce248.configFile.py
$ cernopendata-client get-file-locations --recid 3005 --protocol http --server http://opendata-dev.cern.ch
http://opendata-dev.cern.ch/eos/opendata/cms/configuration-files/2011/0d0714743f0204ed3c0144941e6ce248.configFile.py
$ cernopendata-client get-file-locations --recid 3005 --protocol http --server https://opendata-dev.cern.ch
https://opendata-dev.cern.ch/eos/opendata/cms/configuration-files/2011/0d0714743f0204ed3c0144941e6ce248.configFile.py
That is, even if users force HTTP it is HTTPS which is used.
Two solutions:
Let's verify strictly that HTTP protocol means HTTP server, and HTTPS protocol means HTTPS server, and always raise errors for HTTP/HTTPS mixtures.
Let's remove https
protocol from options, keeping only http
or xrootd
, and let's accept --server http://...
or --server https://...
as valid possibilities, and let's start either HTTP or HTTPS transler based on that.
I think the second option would be more user friendly. We don't really need two separate options to specify this. If users specify the protocol already as part of the server, then we can take that. (Kind of like people write firefox http://example.org
or firefox https://example.org
without worrying about any other command line options.)