Bug #80656 curl https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.11-win32.zip fails
Submitted: 8 Mar 2016 10:46 Modified: 9 Mar 2016 8:59
Reporter: FRANCIS ANDRE Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Package Repos Severity:S3 (Non-critical)
Version:5.7 OS:Any
Assigned to: CPU Architecture:Any

[8 Mar 2016 10:46] FRANCIS ANDRE
Description:
Hi

On CI platform like Travis or AppVeyor, one should download dependent packages by "hand" using curl or whaterer internet tool. Using curl on this URL
https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.11-win32.zip
result in no zip file downloaded while it is really needed.

Thus MySQL should provides a unattended mode for downloading its x86 and x64 packages.

How to repeat:
[FrancisANDRE@idefix temp ]$ll
total 0
[FrancisANDRE@idefix temp ]$curl -verbose https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.11-win32.zip
* STATE: INIT => CONNECT handle 0x80048358; line 1103 (connection #-5000)
* Added connection 0. The cache now contains 1 members
*   Trying 137.254.60.11...
* STATE: CONNECT => WAITCONNECT handle 0x80048358; line 1156 (connection #0)
* Connected to dev.mysql.com (137.254.60.11) port 443 (#0)
* STATE: WAITCONNECT => SENDPROTOCONNECT handle 0x80048358; line 1253 (connection #0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* TLSv1.2 (OUT), TLS header, Certificate Status (22):
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* STATE: SENDPROTOCONNECT => PROTOCONNECT handle 0x80048358; line 1267 (connection #0)
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-SHA
* ALPN, server did not agree to a protocol
* Server certificate:
*        subject: C=US; ST=California; L=Redwood City; O=Oracle Corporation; OU=PDIT Network Services; CN=www.mysql.com
*        start date: Nov 26 00:00:00 2015 GMT
*        expire date: Mar 29 23:59:59 2016 GMT
*        subjectAltName: dev.mysql.com matched
*        issuer: C=US; O=Oracle Corporation; OU=Symantec Trust Network; CN=Oracle SSL CA - G2
*        SSL certificate verify ok.
* STATE: PROTOCONNECT => DO handle 0x80048358; line 1288 (connection #0)
> GET /get/Downloads/MySQL-5.7/mysql-5.7.11-win32.zip HTTP/1.1
> Host: dev.mysql.com
> User-Agent: curl/7.47.1
> Accept: */*
> Referer: rbose
>
* STATE: DO => DO_DONE handle 0x80048358; line 1350 (connection #0)
* STATE: DO_DONE => WAITPERFORM handle 0x80048358; line 1477 (connection #0)
* STATE: WAITPERFORM => PERFORM handle 0x80048358; line 1487 (connection #0)
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 302 Found
< Date: Tue, 08 Mar 2016 10:46:05 GMT
* Server Apache/2.2 is not blacklisted
< Server: Apache/2.2
< Set-Cookie: MySQL_S=kgtsj58jmt1f05ls68hu5q0cb4tv2dq9; path=/; domain=mysql.com; HttpOnly
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< Pragma: no-cache
< Location: http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.11-win32.zip
< Vary: Accept-Encoding
< Content-Length: 0
< Content-Type: text/html; charset=UTF-8
<
* STATE: PERFORM => DONE handle 0x80048358; line 1645 (connection #0)
* Curl_done
* Connection #0 to host dev.mysql.com left intact
[FrancisANDRE@idefix temp ]$ll
total 0
[FrancisANDRE@idefix temp ]$
[8 Mar 2016 13:17] MySQL Verification Team
Hello FRANCIS,

Thank you for the report.

Thanks,
Umesh
[8 Mar 2016 13:30] Tsubasa Tanaka
What you need is `curl -L` ?

```
$ curl -L -verbose https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.11-win32.zip > mysq
l-5.7.11-win32.zip
* About to connect() to dev.mysql.com port 443 (#0)
*   Trying 137.254.60.11... connected
* Connected to dev.mysql.com (137.254.60.11) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using TLS_RSA_WITH_AES_128_CBC_SHA
* Server certificate:
*       subject: CN=www.mysql.com,OU=PDIT Network Services,O=Oracle Corporation,L=Redwood City,ST=California,C=US
*       start date: Nov 26 00:00:00 2015 GMT
*       expire date: Mar 29 23:59:59 2016 GMT
*       common name: www.mysql.com
*       issuer: CN=Oracle SSL CA - G2,OU=Symantec Trust Network,O=Oracle Corporation,C=US
> GET /get/Downloads/MySQL-5.7/mysql-5.7.11-win32.zip HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: dev.mysql.com
> Accept: */*
> Referer: rbose
>
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0< HTTP/1.1 302 Found
< Date: Tue, 08 Mar 2016 13:29:07 GMT
< Server: Apache/2.2
< Set-Cookie: MySQL_S=48pju74mdg6stvo8d5vjahtn4ivcrj2h; path=/; domain=mysql.com; HttpOnly
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
< Pragma: no-cache
< Location: http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.11-win32.zip
< Vary: Accept-Encoding
< Content-Length: 0
< Content-Type: text/html; charset=UTF-8
<
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* Connection #0 to host dev.mysql.com left intact
* Issue another request to this URL: 'http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.11-win32.zip'
* About to connect() to cdn.mysql.com port 80 (#1)
*   Trying 104.78.24.15... connected
* Connected to cdn.mysql.com (104.78.24.15) port 80 (#1)
> GET //Downloads/MySQL-5.7/mysql-5.7.11-win32.zip HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.19.1 Basic ECC zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: cdn.mysql.com
> Accept: */*
> Referer: rbose
>
< HTTP/1.1 200 OK
< Server: Apache
< Accept-Ranges: bytes
< Last-Modified: Mon, 01 Feb 2016 23:57:23 GMT
< ETag: "710b588c8df3134c87818f765118329a:1454508119"
< Content-Length: 339165556
< Date: Tue, 08 Mar 2016 13:29:07 GMT
< Connection: keep-alive
< Content-Type: application/zip
<
{ [data not shown]
100  323M  100  323M    0     0  12.5M      0  0:00:25  0:00:25 --:--:-- 11.5M* Connection #1 to host cdn.mysql.com left intact

* Closing connection #0
* Closing connection #1

$ ls -l mysql-5.7.11-win32.zip
-rw-rw-r-- 1 yoku0825 yoku0825 339165556 Mar  8 22:30 mysql-5.7.11-win32.zip
```
[9 Mar 2016 4:19] MySQL Verification Team
Thanks tanaka-San, indeed it works.
FRANCIS - could you please try and confirm?

Thanks,
Umesh
[9 Mar 2016 8:59] FRANCIS ANDRE
Yes it works. Thanks