Skip to content

Instantly share code, notes, and snippets.

@xquery
Last active October 6, 2020 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xquery/e65b99054221368e13ad095c6abbf252 to your computer and use it in GitHub Desktop.
Save xquery/e65b99054221368e13ad095c6abbf252 to your computer and use it in GitHub Desktop.
the first works, the 2nd (with 2 https calls) does not - errors with error:1408F10B:SSL routines:ssl3_get_record:wrong version number
13:16:37.634496 == Info: STATE: INIT => CONNECT handle 0x714ebd8; line 1796 (connection #-5000)
13:16:37.695488 == Info: Added connection 0. The cache now contains 1 members
13:16:37.726468 == Info: family0 == v6, family1 == v4
13:16:37.734480 == Info: Trying ::1:25089...
13:16:37.757305 == Info: Immediate connect fail for ::1: Cannot assign requested address
13:16:37.759790 == Info: Trying 127.0.0.1:25089...
13:16:37.762568 == Info: STATE: CONNECT => WAITCONNECT handle 0x714ebd8; line 1857 (connection #0)
13:16:37.842983 == Info: Connected to localhost (127.0.0.1) port 25089 (#0)
13:16:37.843851 == Info: STATE: WAITCONNECT => SENDPROTOCONNECT handle 0x714ebd8; line 1990 (connection #0)
13:16:37.845344 == Info: Marked for [keep alive]: HTTP default
13:16:37.955784 == Info: ALPN, offering h2
13:16:37.956155 == Info: ALPN, offering http/1.1
13:16:38.045875 == Info: successfully set certificate verify locations:
13:16:38.046352 == Info: CAfile: ./certs/EdelCurlRoot-ca.crt
13:16:38.046602 == Info: CApath: none
13:16:38.207641 => Send SSL data, 5 bytes (0x5)
0000: .....
13:16:38.216135 == Info: TLSv1.3 (OUT), TLS handshake, Client hello (1):
13:16:38.216300 => Send SSL data, 512 bytes (0x200)
0000: ......e...$!..(. ..>.il..~.cP3Q..|.;1a N....k..y.}..{..4....y...
0040: X.......>.......,.0.........+./...$.(.k.#.'.g.....9.....3.....=.
0080: <.5./.....u.........localhost........................3t.........
00c0: h2.http/1.1.........1.....0.....................................
0100: ............+............-.....3.&.$... ..c!vO..y.|"*.......L...
0140: ......Xh........................................................
0180: ................................................................
01c0: ................................................................
13:16:38.225083 <= Recv SSL data, 5 bytes (0x5)
0000: ....X
13:16:38.232139 == Info: TLSv1.3 (IN), TLS handshake, Server hello (2):
13:16:38.232243 <= Recv SSL data, 88 bytes (0x58)
0000: ...T...!.t..a......e......z..^......3. N....k..y.}..{..4....y...
0040: X............+.....3....
13:16:38.275610 => Send SSL data, 5 bytes (0x5)
0000: .....
13:16:38.276583 == Info: TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
13:16:38.276687 => Send SSL data, 1 bytes (0x1)
0000: .
13:16:38.385476 => Send SSL data, 5 bytes (0x5)
0000: .....
13:16:38.386313 == Info: TLSv1.3 (OUT), TLS handshake, Client hello (1):
13:16:38.386417 => Send SSL data, 512 bytes (0x200)
0000: ......e...$!..(. ..>.il..~.cP3Q..|.;1a N....k..y.}..{..4....y...
0040: X.......>.......,.0.........+./...$.(.k.#.'.g.....9.....3.....=.
0080: <.5./.....u.........localhost........................3t.........
00c0: h2.http/1.1.........1.....0.....................................
0100: ............+............-.....3.G.E...A..s;3ky&0.7.~......OXI(.
0140: }..xr...G.w..B..0..J..|&._5a..,7.Ea.............................
0180: ................................................................
01c0: ................................................................
13:16:38.389982 <= Recv SSL data, 5 bytes (0x5)
0000: .....
13:16:38.394299 == Info: STATE: SENDPROTOCONNECT => PROTOCONNECT handle 0x714ebd8; line 2008 (connection #0)
13:16:38.424066 <= Recv SSL data, 5 bytes (0x5)
0000: .....
13:16:38.424859 == Info: TLSv1.3 (IN), TLS handshake, Server hello (2):
13:16:38.424963 <= Recv SSL data, 155 bytes (0x9b)
0000: ........B2.....M...^...?.*N.\@....7... N....k..y.}..{..4....y...
0040: X..........O.+.....3.E...A..Ifki.....I....RTPYs.x.)..6..l.T."D.e
0080: `e$....+...8r6VN.O.D.5.C..9
13:16:38.509367 <= Recv SSL data, 5 bytes (0x5)
0000: .....
13:16:38.521390 <= Recv SSL data, 1 bytes (0x1)
0000: .
13:16:38.522604 == Info: TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
13:16:38.522710 <= Recv SSL data, 10 bytes (0xa)
0000: ..........
13:16:38.525219 <= Recv SSL data, 5 bytes (0x5)
0000: .....
13:16:38.536649 <= Recv SSL data, 1 bytes (0x1)
0000: .
13:16:38.538294 == Info: TLSv1.3 (IN), TLS handshake, Certificate (11):
13:16:38.538391 <= Recv SSL data, 980 bytes (0x3d4)
0000: ...........0...0............f..S0...*.H........0h1.0...U....NN11
0040: 0/..U...(Edel Curl Arctic Illudium Research Cloud1&0$..U....Nort
0080: hern Nowhere Trust Anchor0...180919071314Z..261206071314Z0T1.0..
00c0: .U....NN110/..U...(Edel Curl Arctic Illudium Research Cloud1.0..
0100: .U....localhost0.."0...*.H.............0..........0P.p.3...^Z..
0140: .."..:A.v....$."yG&Mj.A.1. ._:./O.\#.g...X.G.v.S...#.....G.`....
0180: ........FTB.+.5.j.F..G.w..H.\.....=). ...`'b.s....-<...>.....P..
01c0: ..2.-.a.....)?I..J.u0.b..k.MqD@9....sA.....].)v.k...,C^...P.-.m.
0200: .....F.;.....T..&,O.`..!9.D(...y..D. ..eT.'Vg..'........0..0...U
0240: ....0...localhost0...U........0...U.%..0...+.......0...U.......6
0280: .S...dG.S..i......0...U.#..0......KF..u.,..T...e.{.0...U....0.0.
02c0: ..*.H.............*....Ic/....C......k.@+..X.$W..Q..".}W........
0300: xY4#.h......ve..$..C..+..K.i....TS.%.]."........;o<..s_..l;A.;..
0340: h......(.8#.......g......-v.zUw1I-@z.?..P..:...u6P)\&.EC.%x.....
0380: 9ppFwH.dz.W_M...W......&.KT-.*..o..J.L.....Z'..l.U,cP.6.....h ~.
03c0: .|....hO>.....4....
13:16:38.717597 <= Recv SSL data, 5 bytes (0x5)
0000: .....
13:16:38.720788 <= Recv SSL data, 1 bytes (0x1)
0000: .
13:16:38.721721 == Info: TLSv1.3 (IN), TLS handshake, CERT verify (15):
13:16:38.721830 <= Recv SSL data, 264 bytes (0x108)
0000: ........L.......(.@..S9`.....Z..2}./@'..e.Pb..+l.zJn6.Ia>......
0040: .:.j...4......nf.3...$..."...K.k..).....D.].W.....4..U.......'>
0080: .Xa.....3".w.Z1..F......X.]+.._.z{.zS.=.(M..1..H..W.2 .._"c0..].
00c0: ..Z..".........u..;Z.?9......y1.d.f..Z}.....+.....P.Q..q.9.E<"}
0100: :-......
13:16:38.738127 <= Recv SSL data, 5 bytes (0x5)
0000: ....E
13:16:38.739581 <= Recv SSL data, 1 bytes (0x1)
0000: .
13:16:38.748777 == Info: TLSv1.3 (IN), TLS handshake, Finished (20):
13:16:38.748889 <= Recv SSL data, 52 bytes (0x34)
0000: ...0..{....e..q6....Z.bt.:W4]...d.......p.LK..A.}..
13:16:38.762404 => Send SSL data, 5 bytes (0x5)
0000: ....E
13:16:38.763164 => Send SSL data, 1 bytes (0x1)
0000: .
13:16:38.763979 == Info: TLSv1.3 (OUT), TLS handshake, Finished (20):
13:16:38.764080 => Send SSL data, 52 bytes (0x34)
0000: ...0...A....t.q.r9q...$..g....YD.....|^0...".......
13:16:38.770766 == Info: SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384
13:16:38.771448 == Info: ALPN, server did not agree to a protocol
13:16:38.773735 == Info: Server certificate:
13:16:38.780632 == Info: subject: C=NN; O=Edel Curl Arctic Illudium Research Cloud; CN=localhost
13:16:38.786972 == Info: start date: Sep 19 07:13:14 2018 GMT
13:16:38.788195 == Info: expire date: Dec 6 07:13:14 2026 GMT
13:16:38.791891 == Info: subjectAltName: host "localhost" matched cert's "localhost"
13:16:38.793972 == Info: issuer: C=NN; O=Edel Curl Arctic Illudium Research Cloud; CN=Northern Nowhere Trust Anchor
13:16:38.794608 == Info: SSL certificate verify ok.
13:16:38.795955 == Info: STATE: PROTOCONNECT => DO handle 0x714ebd8; line 2027 (connection #0)
13:16:38.810957 => Send SSL data, 5 bytes (0x5)
0000: ....g
13:16:38.811634 => Send SSL data, 1 bytes (0x1)
0000: .
13:16:38.813133 => Send header, 86 bytes (0x56)
0000: GET /360 HTTP/1.1
0013: Host: localhost:25089
002a: User-Agent: curl/7.73.0-DEV
0047: Accept: */*
0054:
13:16:38.817241 == Info: STATE: DO => DO_DONE handle 0x714ebd8; line 2082 (connection #0)
13:16:38.817832 == Info: STATE: DO_DONE => PERFORM handle 0x714ebd8; line 2203 (connection #0)
13:16:38.821252 <= Recv SSL data, 5 bytes (0x5)
0000: ....J
13:16:38.821816 <= Recv SSL data, 1 bytes (0x1)
0000: .
13:16:38.823666 == Info: TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
13:16:38.823780 <= Recv SSL data, 57 bytes (0x39)
0000: ...5...,...>.......... ....q..k\_.bN.$.....DC ..>.k......
13:16:38.835230 <= Recv SSL data, 5 bytes (0x5)
0000: ....J
13:16:38.835790 <= Recv SSL data, 1 bytes (0x1)
0000: .
13:16:38.836640 == Info: TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
13:16:38.836741 <= Recv SSL data, 57 bytes (0x39)
0000: ...5...,..;!.......... ...0.F..;....u."...Qi.!..W.......
13:16:38.840846 == Info: old SSL session ID is stale, removing
13:16:38.842868 <= Recv SSL data, 5 bytes (0x5)
0000: ....%
13:16:38.843418 <= Recv SSL data, 1 bytes (0x1)
0000: .
13:16:38.851976 == Info: Mark bundle as not supporting multiuse
13:16:38.852729 == Info: HTTP 1.1 or later with persistent connection
13:16:38.855220 <= Recv header, 16 bytes (0x10)
0000: HTTP/1.1 200 OK.
13:16:38.867080 <= Recv SSL data, 5 bytes (0x5)
0000: .....
13:16:38.867921 <= Recv SSL data, 1 bytes (0x1)
0000: .
13:16:38.868595 <= Recv header, 36 bytes (0x24)
0000: Date: Thu, 09 Nov 2010 14:49:00 GMT.
13:16:38.870432 <= Recv header, 18 bytes (0x12)
0000: Content-Length: 6.
13:16:38.872047 == Info: Marked for [closure]: Connection: close used
13:16:38.872222 <= Recv header, 18 bytes (0x12)
0000: Connection: close.
13:16:38.874382 <= Recv header, 24 bytes (0x18)
0000: Content-Type: text/html.
13:16:38.875003 <= Recv header, 19 bytes (0x13)
0000: Funny-head: yesyes.
13:16:38.880529 == Info: Added alt-svc: localhost:23425 over h2
13:16:38.881363 <= Recv header, 55 bytes (0x37)
0000: Alt-Svc: h2="localhost:23425", ma=315360000; persist=0.
13:16:38.884977 <= Recv header, 1 bytes (0x1)
0000: .
13:16:38.886149 <= Recv data, 6 bytes (0x6)
0000: -foo-.
13:16:38.890781 == Info: STATE: PERFORM => DONE handle 0x714ebd8; line 2393 (connection #0)
13:16:38.891238 == Info: multi_done
13:16:38.927639 == Info: The cache now contains 0 members
13:16:38.929647 == Info: Closing connection 0
13:16:38.932297 => Send SSL data, 5 bytes (0x5)
0000: .....
13:16:38.932841 => Send SSL data, 1 bytes (0x1)
0000: .
13:16:38.934133 == Info: TLSv1.3 (OUT), TLS alert, close notify (256):
13:16:38.934232 => Send SSL data, 2 bytes (0x2)
0000: ..
13:16:38.957182 == Info: Expire cleared (transfer 0x714ebd8)
13:16:39.010529 == Info: STATE: INIT => CONNECT handle 0x72be828; line 1796 (connection #-5000)
13:16:39.013144 == Info: Alt-svc connecting from [h1]localhost:25089 to [h2]localhost:23425
13:16:39.014417 == Info: Added connection 1. The cache now contains 1 members
13:16:39.016440 == Info: family0 == v6, family1 == v4
13:16:39.016602 == Info: Trying ::1:23425...
13:16:39.016874 == Info: Immediate connect fail for ::1: Cannot assign requested address
13:16:39.017081 == Info: Trying 127.0.0.1:23425...
13:16:39.017396 == Info: STATE: CONNECT => WAITCONNECT handle 0x72be828; line 1857 (connection #1)
13:16:39.081975 == Info: Connected to localhost (127.0.0.1) port 23425 (#1)
13:16:39.082231 == Info: STATE: WAITCONNECT => SENDPROTOCONNECT handle 0x72be828; line 1990 (connection #1)
13:16:39.082373 == Info: Marked for [keep alive]: HTTP default
13:16:39.083875 == Info: ALPN, offering h2
13:16:39.083980 == Info: ALPN, offering http/1.1
13:16:39.088200 == Info: successfully set certificate verify locations:
13:16:39.088332 == Info: CAfile: ./certs/EdelCurlRoot-ca.crt
13:16:39.088432 == Info: CApath: none
13:16:39.091572 => Send SSL data, 5 bytes (0x5)
0000: .....
13:16:39.092121 == Info: TLSv1.3 (OUT), TLS handshake, Client hello (1):
13:16:39.092253 => Send SSL data, 512 bytes (0x200)
0000: ......Et.5l..i.SN%._.3.;.._..YAo../..0 S.........<&..9...}.K .
0040: H.2.~..>.......,.0.........+./...$.(.k.#.'.g.....9.....3.....=.
0080: <.5./.....u.........localhost........................3t.........
00c0: h2.http/1.1.........1.....0.....................................
0100: ............+............-.....3.&.$... L...'_N.E....'g.....Q^..
0140: .....S.C........................................................
0180: ................................................................
01c0: ................................................................
13:16:39.095271 == Info: STATE: SENDPROTOCONNECT => PROTOCONNECT handle 0x72be828; line 2008 (connection #1)
13:16:39.095948 <= Recv SSL data, 5 bytes (0x5)
0000: HTTP/
13:16:39.102970 == Info: error:1408F10B:SSL routines:ssl3_get_record:wrong version number
13:16:39.103385 == Info: Marked for [closure]: Failed HTTPS connection
13:16:39.103757 == Info: multi_done
13:16:39.127535 == Info: The cache now contains 0 members
13:16:39.127662 == Info: Closing connection 1
13:16:39.129333 == Info: Expire cleared (transfer 0x72be828)
<testcase>
<info>
<keywords>
HTTPS
HTTPS GET
Alt-Svc
HTTP/2
</keywords>
</info>
#
# Server-side
<reply>
<data nocheck="yes">
HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 6
Connection: close
Content-Type: text/html
Funny-head: yesyes
Alt-Svc: h2="localhost:%HTTP2PORT", ma=315360000; persist=0
-foo-
</data>
</reply>
#
# Client-side
<client>
<features>
SSL
alt-svc
debug
</features>
<server>
https Server-localhost-sv.pem
http/2
</server>
<name>
HTTPS GET translated by alt-svc lookup to HTTP/2 GET
</name>
<setenv>
# make debug-curl accept Alt-Svc over plain HTTP
CURL_ALTSVC_HTTP="yeah"
</setenv>
<command>
--http2 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --alt-svc "log/altsvc-360" "https://localhost:%HTTPSPORT/360" "https://localhost:%HTTPSPORT/360"
</command>
<precheck>
perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );"
</precheck>
</client>
#
# Verify data after the test has been "shot"
<verify>
<stripfile>
# strip out the (dynamic) expire date from the file so that the rest
# matches
s/\"2([^\"]*)\"/TIMESTAMP/
</stripfile>
<file name="log/altsvc-360" mode="text">
# Your alt-svc cache. https://curl.haxx.se/docs/alt-svc.html
# This file was generated by libcurl! Edit at your own risk.
h1 localhost %HTTPSPORT h2 localhost %HTTP2PORT TIMESTAMP 0 0
</file>
</verify>
</testcase>
<testcase>
<info>
<keywords>
HTTPS
HTTPS GET
Alt-Svc
HTTP/2
</keywords>
</info>
#
# Server-side
<reply>
<data nocheck="yes">
HTTP/1.1 200 OK
Date: Thu, 09 Nov 2010 14:49:00 GMT
Content-Length: 6
Connection: close
Content-Type: text/html
Funny-head: yesyes
Alt-Svc: h2="localhost:%HTTP2PORT", ma=315360000; persist=0
-foo-
</data>
</reply>
#
# Client-side
<client>
<features>
SSL
alt-svc
debug
</features>
<server>
https Server-localhost-sv.pem
http/2
</server>
<name>
HTTPS GET translated by alt-svc lookup to HTTP/2 GET
</name>
<setenv>
# make debug-curl accept Alt-Svc over plain HTTP
CURL_ALTSVC_HTTP="yeah"
</setenv>
<command>
--http2 --cacert %SRCDIR/certs/EdelCurlRoot-ca.crt --alt-svc "log/altsvc-360" "https://localhost:%HTTPSPORT/360"
</command>
<precheck>
perl -e "print 'Test requires default test server host' if ( '%HOSTIP' ne '127.0.0.1' );"
</precheck>
</client>
#
# Verify data after the test has been "shot"
<verify>
<stripfile>
# strip out the (dynamic) expire date from the file so that the rest
# matches
s/\"2([^\"]*)\"/TIMESTAMP/
</stripfile>
<file name="log/altsvc-360" mode="text">
# Your alt-svc cache. https://curl.haxx.se/docs/alt-svc.html
# This file was generated by libcurl! Edit at your own risk.
h1 localhost %HTTPSPORT h2 localhost %HTTP2PORT TIMESTAMP 0 0
</file>
</verify>
</testcase>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment