]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
test1632: verify FTP through HTTPS-proxy with connection re-use
authorDaniel Stenberg <daniel@haxx.se>
Thu, 14 May 2020 15:52:40 +0000 (17:52 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 15 May 2020 06:28:56 +0000 (08:28 +0200)
tests/data/Makefile.inc
tests/data/test1632 [new file with mode: 0644]

index 2d6c7323acdc2b27434bc3f6bd7d98ca92139413..02a6636f2ea65be9cf811da7891791df6e8f9a67 100644 (file)
@@ -195,7 +195,7 @@ test1608 test1609 test1610 test1611 test1612 \
 \
 test1620 test1621 \
 \
-test1630 test1631 \
+test1630 test1631 test1632 \
 \
 test1650 test1651 test1652 test1653 test1654 test1655 \
 \
diff --git a/tests/data/test1632 b/tests/data/test1632
new file mode 100644 (file)
index 0000000..b10b2a6
--- /dev/null
@@ -0,0 +1,105 @@
+<testcase>
+<info>
+<keywords>
+FTP
+HTTPS-proxy
+</keywords>
+</info>
+
+# Server-side
+<reply>
+
+# This is the HTTPS proxy response
+<connect>
+HTTP/1.1 200 OK\r
+Date: Thu, 09 Nov 2010 14:49:00 GMT\r
+Server: test-server/fake\r
+Content-Type: text/html\r
+Funny-head: yesyes\r
+Content-Length: 0\r
+\r
+</connect>
+
+# This is the FTP server response. The Life and Adventures of Robinson Crusoe
+<data>
+I was born in the year 1632, in the city of York, of a good family, though not
+of that country, myfather being a foreigner of Bremen, who settled first at
+Hull.  He got a good estate by merchandise,and leaving off his trade, lived
+afterwards at York, from whence he had married my mother, whoserelations were
+named Robinson, a very good family in that country, and from whom I was
+calledRobinson Kreutznaer; but, by the usual corruption of words in England,
+we are now called—nay wecall ourselves and write our name—Crusoe; and so my
+companions always called me.
+</data>
+
+<data2>
+I had two elder brothers, one of whom was lieutenant-colonel to an
+English regiment of foot inFlanders, formerly commanded by the famous Colonel
+Lockhart, and was killed at the battle nearDunkirk against the Spaniards.
+What became of my second brother I never knew, any more thanmy father or
+mother knew what became of me.
+</data2>
+
+</reply>
+
+# Client-side
+<client>
+<server>
+ftp
+https-proxy
+</server>
+ <name>
+FTP through HTTPS-proxy, with connection re-use
+ </name>
+ <command>
+-p -x https://%HOSTIP:%HTTPSPROXYPORT ftp://ftp.site.thru.https.proxy:%FTPPORT/1632 --proxy-insecure ftp://ftp.site.thru.https.proxy:%FTPPORT/16320002
+</command>
+<features>
+proxy
+</features>
+</client>
+
+# Verify data after the test has been "shot"
+<verify>
+
+# The second and third CONNECT will be made to the dynamic port number the FTP
+# server opens for us, so we can't compare with known pre-existing numbers!
+
+<strippart>
+s/((https.proxy):(\d+))/$2:12345/
+s/^(User-Agent: curl).*/$1/
+</strippart>
+<proxy>
+CONNECT ftp.site.thru.https.proxy:12345 HTTP/1.1\r
+Host: ftp.site.thru.https.proxy:12345\r
+User-Agent: curl
+Proxy-Connection: Keep-Alive\r
+\r
+CONNECT ftp.site.thru.https.proxy:12345 HTTP/1.1\r
+Host: ftp.site.thru.https.proxy:12345\r
+User-Agent: curl
+Proxy-Connection: Keep-Alive\r
+\r
+CONNECT ftp.site.thru.https.proxy:12345 HTTP/1.1\r
+Host: ftp.site.thru.https.proxy:12345\r
+User-Agent: curl
+Proxy-Connection: Keep-Alive\r
+\r
+</proxy>
+<protocol>
+USER anonymous\r
+PASS ftp@example.com\r
+PBSZ 0\r
+PROT P\r
+PWD\r
+EPSV\r
+TYPE I\r
+SIZE 1632\r
+RETR 1632\r
+EPSV\r
+SIZE 16320002\r
+RETR 16320002\r
+QUIT\r
+</protocol>
+</verify>
+</testcase>