You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run grpcping to Fortio server with -cert flag produces expected failure:
$ docker exec fortio /usr/local/bin/fortio grpcping -cert /etc/ssl/certs/server.crt localhost
16:12:39 I grpcrunner.go:54> Using server certificate /etc/ssl/certs/server.crt to construct TLS credentials
16:12:39 E pingsrv.go:97> grpc error from Ping0 rpc error: code = Unavailable desc = all SubConns are in TransientFailure
The server log shows expected nil auth info:
22:44:35 V pingsrv.go:44> Ping called {Seq:1 Ts:1522277075995698888 Payload:} (ctx context.Background.WithCancel.WithCancel.WithValue(peer.peerKey{}, &peer.Peer{Addr:(*net.TCPAddr)(0xc4202c2c90), AuthInfo:credentials.AuthInfo(nil)}).WithValue(transport.streamKey{}, <stream: 0xc4200da780, /fgrpc.PingServer/Ping>).WithValue(metadata.mdIncomingKey{}, metadata.MD{":authority":[]string{"localhost:8079"}, "user-agent":[]string{"grpc-go/1.9.2"}}))
Run load with -grpc flag produces expected success:
$ docker exec fortio /usr/local/bin/fortio load -grpc http://localhost:8079
Fortio 0.8.1-pre running at 8 queries per second, 4->4 procs, for 5s: http://localhost:8079
19:07:41 I grpcrunner.go:109> Starting grpc test for http://localhost:8079 with 4 threads at 8.0 qps
19:07:41 I grpcrunner.go:191> stripping http scheme. grpc destination: localhost:8079
19:07:41 I grpcrunner.go:191> stripping http scheme. grpc destination: localhost:8079
19:07:41 I grpcrunner.go:191> stripping http scheme. grpc destination: localhost:8079
19:07:41 I grpcrunner.go:191> stripping http scheme. grpc destination: localhost:8079
Starting at 8 qps with 4 thread(s) [gomax 4] for 5s : 10 calls each (total 40)
19:07:46 I periodic.go:530> T000 ended after 5.000993508s : 10 calls. qps=1.9996026757489644
19:07:46 I periodic.go:530> T003 ended after 5.001086606s : 10 calls. qps=1.9995654520364847
19:07:46 I periodic.go:530> T002 ended after 5.001232211s : 10 calls. qps=1.9995072370375886
19:07:46 I periodic.go:530> T001 ended after 5.001313023s : 10 calls. qps=1.9994749286861424
Ended after 5.001877257s : 40 calls. qps=7.997
Sleep times : count 36 avg 0.55323591 +/- 0.001024 min 0.551194545 max 0.55484959 sum 19.9164927
Aggregated Function Time : count 40 avg 0.00080073598 +/- 0.0001849 min 0.000439024 max 0.001195842 sum 0.032029439
# range, mid point, percentile, count
>= 0.000439024 <= 0.001 , 0.000719512 , 82.50, 33
> 0.001 <= 0.00119584 , 0.00109792 , 100.00, 7
# target 50% 0.000772104
# target 75% 0.000947409
# target 90% 0.00108393
# target 99% 0.00118465
# target 99.9% 0.00119472
Health SERVING : 40
All done 40 calls (plus 4 warmup) 0.801 ms avg, 8.0 qps
Run load with the -curl flag produces expected success:
Start the server with the -cert and -key flags. Note: the use of the cert/key in the log msgs:
$ docker run --rm --name fortio -p 8080:8080 -p 8079:8079 --mount type=bind,source=/Users/daneyonhansen/code/go/src/istio.io/fortio/testdata,target=/etc/ssl/certs istio/fortio:webtest server -loglevel debug -cert /etc/ssl/certs/server.crt -key /etc/ssl/certs/server.key
16:41:29 I logger.go:97> Log level is now 0 Debug (was 2 Info)
16:41:29 V stats.go:517> Will use [50 75 90 99 99.9] for percentiles
Fortio 0.8.1-pre grpc 'ping' server listening on [::]:8079
16:41:29 I pingsrv.go:67> Using server certificate /etc/ssl/certs/server.crt to construct TLS credentials
16:41:29 I pingsrv.go:68> Using server key /etc/ssl/certs/server.key to construct TLS credentials
<SNIP>
Run a grpcping to Fortio server by specifying the -cert flag produces expected success. Note: the use of a cert in the log msg:
$ docker exec fortio /usr/local/bin/fortio grpcping -cert /etc/ssl/certs/server.crt localhost
16:00:10 I grpcrunner.go:54> Using server certificate /etc/ssl/certs/server.crt to construct TLS credentials
16:00:10 I pingsrv.go:129> Ping RTT 501452 (avg of 595441, 537088, 371828 ns) clock skew 31094
Clock skew histogram usec : count 1 avg 31.094 +/- 0 min 31.094 max 31.094 sum 31.094
# range, mid point, percentile, count
>= 31.094 <= 31.094 , 31.094 , 100.00, 1
# target 50% 31.094
RTT histogram usec : count 3 avg 501.45233 +/- 94.7 min 371.828 max 595.441 sum 1504.357
# range, mid point, percentile, count
>= 371.828 <= 400 , 385.914 , 33.33, 1
> 500 <= 595.441 , 547.721 , 100.00, 2
# target 50% 523.86
Run a grpcping without TLS produces expected failure. Note: no use of a cert in the log msg:
$ docker exec fortio /usr/local/bin/fortio grpcping localhost
16:21:57 E pingsrv.go:97> grpc error from Ping0 rpc error: code = Unavailable desc = transport is closing
Run load with -cert and -grpc flags produces expected success:
$ docker exec fortio /usr/local/bin/fortio load -cert /etc/ssl/certs/server.crt -grpc localhost:8079
Fortio 0.8.1-pre running at 8 queries per second, 4->4 procs, for 5s: localhost:8079
18:44:51 I grpcrunner.go:109> Starting grpc test for localhost:8079 with 4 threads at 8.0 qps
18:44:51 I grpcrunner.go:54> Using server certificate /etc/ssl/certs/server.crt to construct TLS credentials
18:44:51 I grpcrunner.go:54> Using server certificate /etc/ssl/certs/server.crt to construct TLS credentials
18:44:51 I grpcrunner.go:54> Using server certificate /etc/ssl/certs/server.crt to construct TLS credentials
18:44:51 I grpcrunner.go:54> Using server certificate /etc/ssl/certs/server.crt to construct TLS credentials
Starting at 8 qps with 4 thread(s) [gomax 4] for 5s : 10 calls each (total 40)
18:44:56 I periodic.go:530> T001 ended after 5.002305801s : 10 calls. qps=1.9990781047414017
18:44:56 I periodic.go:530> T000 ended after 5.002340735s : 10 calls. qps=1.9990641441181236
18:44:56 I periodic.go:530> T002 ended after 5.002422332s : 10 calls. qps=1.9990315363880795
18:44:56 I periodic.go:530> T003 ended after 5.002957803s : 10 calls. qps=1.9988175782741056
Ended after 5.00298477s : 40 calls. qps=7.9952
Sleep times : count 36 avg 0.55307956 +/- 0.001636 min 0.548399675 max 0.554982932 sum 19.9108642
Aggregated Function Time : count 40 avg 0.00079165597 +/- 0.0002743 min 0.000427438 max 0.001788292 sum 0.031666239
# range, mid point, percentile, count
>= 0.000427438 <= 0.001 , 0.000713719 , 85.00, 34
> 0.001 <= 0.00178829 , 0.00139415 , 100.00, 6
# target 50% 0.000757095
# target 75% 0.000930599
# target 90% 0.00126276
# target 99% 0.00173574
# target 99.9% 0.00178304
Health SERVING : 40
All done 40 calls (plus 4 warmup) 0.792 ms avg, 8.0 qps
Run load with -grpc flag and without -cert flag produces expected failure:
$ docker exec fortio /usr/local/bin/fortio load -grpc localhost:8079
Fortio 0.8.1-pre running at 8 queries per second, 4->4 procs, for 5s: localhost:8079
18:49:25 I grpcrunner.go:109> Starting grpc test for localhost:8079 with 4 threads at 8.0 qps
18:49:25 E grpcrunner.go:134> Error in first grpc health check call for localhost:8079 rpc error: code = Unavailable desc = transport is closing
Aborting because rpc error: code = Unavailable desc = transport is closing
Run load with the -curl flag produces expected success:
Test Case 3: A dedicated grpcping client container and ping fortio.istio.io. Note: This provides backwards compatability support.
Run grpcping w/o -cert flag produces expected success:
# To https endpoint
$ docker run --rm --name client istio/fortio:webtest grpcping https://fortio.istio.io:443
16:26:47 I grpcrunner.go:194> stripping https scheme. grpc destination: fortio.istio.io:443
Clock skew histogram usec : count 1 avg 12329.795 +/- 0 min 12329.795 max 12329.795 sum 12329.795
# range, mid point, percentile, count
>= 12329.8 <= 12329.8 , 12329.8 , 100.00, 1
# target 50% 12329.8
# To http endpoint
$ docker run --rm --name client istio/fortio:webtest grpcping http://fortio.istio.io:80
17:08:49 I grpcrunner.go:191> stripping http scheme. grpc destination: fortio.istio.io:80
17:08:50 I pingsrv.go:129> Ping RTT 43274644 (avg of 45264564, 42432889, 42126481 ns) clock skew 12981840
Clock skew histogram usec : count 1 avg 12981.84 +/- 0 min 12981.84 max 12981.84 sum 12981.84
# range, mid point, percentile, count
>= 12981.8 <= 12981.8 , 12981.8 , 100.00, 1
# target 50% 12981.8
RTT histogram usec : count 3 avg 43274.645 +/- 1413 min 42126.481 max 45264.564 sum 129823.934
# range, mid point, percentile, count
>= 42126.5 <= 45264.6 , 43695.5 , 100.00, 3
# target 50% 42911
Run grpcping with -cert flag to https://fortio.istio.io:443 and observe expected failure:
$ docker run --rm --name client --mount type=bind,source=/Users/daneyonhansen/code/go/src/istio.io/fortio/testdata,target=/etc/ssl/certs istio/fortio:webtest grpcping -cert /etc/ssl/certs/server.crt https://fortio.istio.io:443
16:34:39 I grpcrunner.go:54> Using server certificate /etc/ssl/certs/server.crt to construct TLS credentials
16:34:39 I grpcrunner.go:194> stripping https scheme. grpc destination: fortio.istio.io:443
16:34:40 E pingsrv.go:97> grpc error from Ping0 rpc error: code = Unavailable desc = all SubConns are in TransientFailure
Test Case 4: Mulit-Host TLS
Generate new TLS assets that use a real domain name and IP address to test multi-host mTLS. Set SAN env, run cert-gen script and copy server crt/key to /testdata dir:
$ export SAN=DNS.1:fortio,IP.1:172.17.0.2
$ ./cert-gen
Creating example CA, server cert/key, and client cert/key...
<SNIP>
X509v3 Subject Alternative Name:
DNS:fortio, IP Address:172.17.0.2
<SNIP>
$cp server.crt ../istio.io/fortio/testdata/server.crt.multihost
$cp server.key ../istio.io/fortio/testdata/server.key.multihost
Start Fortio server with -cert and -key flags.
$ docker run --rm --name fortio -p 8080:8080 -p 8079:8079 --mount type=bind,source=/Users/daneyonhansen/code/go/src/istio.io/fortio/testdata,target=/etc/ssl/certs istio/fortio:webtest server -loglevel debug -cert /etc/ssl/certs/server.crt.multihost -key /etc/ssl/certs/server.key.multihost
16:41:29 I logger.go:97> Log level is now 0 Debug (was 2 Info)
16:41:29 V stats.go:517> Will use [50 75 90 99 99.9] for percentiles
Fortio 0.8.1-pre grpc 'ping' server listening on [::]:8079
16:41:29 I pingsrv.go:67> Using server certificate /etc/ssl/certs/server.crt to construct TLS credentials
16:41:29 I pingsrv.go:68> Using server key /etc/ssl/certs/server.key to construct TLS credentials
<SNIP>
A grpcping to Fortio server with `-cert' flag produces expected success when using the IP or domain name used in the cert:
$ echo $FORTIO_IP
172.17.0.2
# By IP
$ docker run --rm --name client --link fortio --mount type=bind,source=/Users/daneyonhansen/code/go/src/istio.io/fortio/testdata,target=/etc/ssl/certs istio/fortio:webtest grpcping -cert /etc/ssl/certs/server.crt.multihost $FORTIO_IP
16:51:33 I grpcrunner.go:54> Using server certificate /etc/ssl/certs/server.crt to construct TLS credentials
Clock skew histogram usec : count 1 avg 41.295 +/- 0 min 41.295 max 41.295 sum 41.295
# range, mid point, percentile, count
>= 41.295 <= 41.295 , 41.295 , 100.00, 1
# target 50% 41.295
RTT histogram usec : count 3 avg 557.011 +/- 88.64 min 469.148 max 678.372 sum 1671.033
# range, mid point, percentile, count
>= 469.148 <= 500 , 484.574 , 33.33, 1
> 500 <= 600 , 550 , 66.67, 1
> 600 <= 678.372 , 639.186 , 100.00, 1
# target 50% 550
16:51:33 I pingsrv.go:129> Ping RTT 557011 (avg of 678372, 523513, 469148 ns) clock skew 41295
# By domain name
$ docker run --rm --name client --link fortio --mount type=bind,source=/Users/daneyonhansen/code/go/src/istio.io/fortio/testdata,target=/etc/ssl/certs istio/fortio:webtest grpcping -cert /etc/ssl/certs/server.crt.multihost fortio
16:52:21 I grpcrunner.go:54> Using server certificate /etc/ssl/certs/server.crt to construct TLS credentials
16:52:21 I pingsrv.go:129> Ping RTT 627621 (avg of 756272, 674047, 452545 ns) clock skew -18254
Clock skew histogram usec : count 1 avg -18.254 +/- 0 min -18.254 max -18.254 sum -18.254
# range, mid point, percentile, count
>= -18.254 <= -18.254 , -18.254 , 100.00, 1
# target 50% -18.254
RTT histogram usec : count 3 avg 627.62133 +/- 128.3 min 452.545 max 756.272 sum 1882.864
# range, mid point, percentile, count
>= 452.545 <= 500 , 476.273 , 33.33, 1
> 600 <= 700 , 650 , 66.67, 1
> 700 <= 756.272 , 728.136 , 100.00, 1
# target 50% 650
A grpcping to Fortio server without `-cert' flag produces expected failure:
$ docker run --rm --name client --link fortio --mount type=bind,source=/Users/daneyonhansen/code/go/src/istio.io/fortio/testdata,target=/etc/ssl/certs istio/fortio:webtest grpcping $FORTIO_IP
16:48:13 E pingsrv.go:97> grpc error from Ping0 rpc error: code = Unavailable desc = transport is closing
Run load with -grpc and -cert flags produces expected success:
$ docker run --rm --name client --link fortio --mount type=bind,source=/Users/daneyonhansen/code/go/src/istio.io/fortio/testdata,target=/etc/ssl/certs istio/fortio:webtest load -cert /etc/ssl/certs/server.crt.multihost -grpc fortio:8079
Fortio 0.8.1-pre running at 8 queries per second, 4->4 procs, for 5s: fortio:8079
18:38:37 I grpcrunner.go:109> Starting grpc test for fortio:8079 with 4 threads at 8.0 qps
18:38:37 I grpcrunner.go:54> Using server certificate /etc/ssl/certs/server.crt.multihost to construct TLS credentials
18:38:37 I grpcrunner.go:54> Using server certificate /etc/ssl/certs/server.crt.multihost to construct TLS credentials
18:38:37 I grpcrunner.go:54> Using server certificate /etc/ssl/certs/server.crt.multihost to construct TLS credentials
18:38:37 I grpcrunner.go:54> Using server certificate /etc/ssl/certs/server.crt.multihost to construct TLS credentials
Starting at 8 qps with 4 thread(s) [gomax 4] for 5s : 10 calls each (total 40)
18:38:42 I periodic.go:530> T001 ended after 5.004429982s : 10 calls. qps=1.9982295757894768
18:38:42 I periodic.go:530> T000 ended after 5.004503722s : 10 calls. qps=1.9982001324206429
18:38:42 I periodic.go:530> T003 ended after 5.004573243s : 10 calls. qps=1.998172374435164
18:38:42 I periodic.go:530> T002 ended after 5.004760837s : 10 calls. qps=1.9980974767206443
Ended after 5.005068708s : 40 calls. qps=7.9919
Sleep times : count 36 avg 0.55315054 +/- 0.001797 min 0.550136455 max 0.554947272 sum 19.9134193
Aggregated Function Time : count 40 avg 0.00078637887 +/- 0.0002105 min 0.000291502 max 0.001145068 sum 0.031455155
# range, mid point, percentile, count
>= 0.000291502 <= 0.001 , 0.000645751 , 82.50, 33
> 0.001 <= 0.00114507 , 0.00107253 , 100.00, 7
# target 50% 0.000712173
# target 75% 0.000933578
# target 90% 0.00106217
# target 99% 0.00113678
# target 99.9% 0.00114424
Health SERVING : 40
All done 40 calls (plus 4 warmup) 0.786 ms avg, 8.0 qps
Run load with -grpc flag and without -cert flag produces expected failure:
$ docker run --rm --name client --link fortio --mount type=bind,source=/Users/daneyonhansen/code/go/src/istio.io/fortio/testdata,target=/etc/ssl/certs istio/fortio:webtest load -grpc fortio:8079
Fortio 0.8.1-pre running at 8 queries per second, 4->4 procs, for 5s: fortio:8079
18:51:56 I grpcrunner.go:109> Starting grpc test for fortio:8079 with 4 threads at 8.0 qps
18:51:56 E grpcrunner.go:134> Error in first grpc health check call for fortio:8079 rpc error: code = Unavailable desc = transport is closing
Aborting because rpc error: code = Unavailable desc = transport is closing
Run load with the -curl flag produces expected success:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters