cta-epfl / downloadservice

1 stars 1 forks source link

why do requests to webdav endpoint redirect to dcache itselt? #61

Closed volodymyrss closed 6 months ago

volodymyrss commented 6 months ago
$ curl -v https://platform.cta.cscs.ch/services/downloadservice/webdav/lst/?token=$JUPYTERHUB_API_TOKEN
*   Trying 148.187.17.28:443...
...
*  subjectAltName: host "platform.cta.cscs.ch" matched cert's "platform.cta.cscs.ch"
*  issuer: C=US; O=Let's Encrypt; CN=R3
*  SSL certificate verify ok.
* using HTTP/2
* [HTTP/2] [1] OPENED stream for https://platform.cta.cscs.ch/services/downloadservice/webdav/lst/?token=...
* [HTTP/2] [1] [:method: GET]
* [HTTP/2] [1] [:scheme: https]
* [HTTP/2] [1] [:authority: platform.cta.cscs.ch]
* [HTTP/2] [1] [:path: /services/downloadservice/webdav/lst/?token=....]
* [HTTP/2] [1] [user-agent: curl/8.4.0]
* [HTTP/2] [1] [accept: */*]
> GET /services/downloadservice/webdav/lst/?token=... HTTP/2
> Host: platform.cta.cscs.ch
> User-Agent: curl/8.4.0
> Accept: */*
> 
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* old SSL session ID is stale, removing
< HTTP/2 302 
< date: Mon, 29 Apr 2024 12:10:15 GMT
< content-type: text/html; charset=utf-8
< content-length: 0
< location: https://dcache.cta.cscs.ch:2880/pnfs/cta.cscs.ch/lst/
< access-control-allow-origin: *
< vary: Cookie
< strict-transport-security: max-age=15724800; includeSubDomains
< 
* Connection #0 to host platform.cta.cscs.ch left intact

(I accidentially put the token in the log, I removed and invalidated it)

volodymyrss commented 6 months ago

Seems like it works with PROPFIND though. Strange.

there is something else I find when trying with rclone webdav.

rclone config:

[jh-staging-ds]
type = webdav
url = https://jh-staging.cta.cscs.ch/services/downloadservice/webdav
vendor = other
bearer_token = ....
~$ rclone ls jh-staging-ds:lst
2024/04/30 09:40:13 ERROR : : error listing: couldn't list files: XML syntax error on line 64: element <link> closed by </head>
2024/04/30 09:40:13 Failed to ls with 2 errors: last error was: couldn't list files: XML syntax error on line 64: element <link> closed by </head>
volodymyrss commented 6 months ago

sorry for the changes, it's given the tight timeline of this week. I propose now to switch to https://github.com/cta-epfl/certificateservice/issues/22