Skip to content

Commit ac01048

Browse files
committed
tris: add NSS server to client interop tests
Similar to boringssl, reuse the NSS client image for the NSS server test against the tris client. Bump the NSS version to 3.34.1 gain support for TLS 1.3 keylogging which is useful while debugging. Adjust read check to fix intermittent NSS test failures: #58
1 parent c89a0a5 commit ac01048

File tree

4 files changed

+25
-4
lines changed

4 files changed

+25
-4
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ go:
99

1010
env:
1111
- MODE=interop CLIENT=boring SERVER=boring
12-
- MODE=interop CLIENT=tstclnt
12+
- MODE=interop CLIENT=tstclnt SERVER=tstclnt
1313
- MODE=interop CLIENT=picotls ZRTT=1
1414
- MODE=interop CLIENT=mint
1515
- MODE=bogo

_dev/tris-testclient/client.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ func (c *Client) run(addr string, version, cipherSuite uint16) {
5757

5858
buf := make([]byte, 1024)
5959
n, err := con.Read(buf)
60-
if err != nil {
60+
// A non-zero read with EOF is acceptable and occurs when a close_notify
61+
// is received right after reading data (observed with NSS selfserv).
62+
if !(n > 0 && err == io.EOF) && err != nil {
6163
fmt.Printf("Read failed: %v\n\n", err)
6264
c.failed++
6365
return

_dev/tstclnt/Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ ENV USE_64=1 NSS_ENABLE_TLS_1_3=1
1717
# Draft 18
1818
# ARG REVISION=b6dfef6d0ff0
1919

20-
# tstclnt resumption
21-
ARG REVISION=2ed8aef0b360
20+
# Draft 18, NSS_3_34_1_RTM (with TLS 1.3 keylogging support)
21+
ARG REVISION=e61c0f657100
2222

2323
RUN cd nss && hg pull
2424
RUN cd nss && hg checkout -C $REVISION
@@ -39,6 +39,14 @@ ENV LD_LIBRARY_PATH=/dist/OBJ-PATH/lib
3939

4040
ENV SSLTRACE=100 SSLDEBUG=100
4141

42+
# Init test key using an empty noise (seed) file (-z /dev/null).
43+
# Use different subjects, otherwise NSS seems to merge keys under the same nickname.
44+
RUN mkdir /certdb && \
45+
/dist/OBJ-PATH/bin/certutil -d /certdb -N --empty-password && \
46+
/dist/OBJ-PATH/bin/certutil -d /certdb -S -n rsa-server -t u -x -s CN=localhost -k rsa -z /dev/null && \
47+
/dist/OBJ-PATH/bin/certutil -d /certdb -S -n ecdsa-server -t u -x -s CN=localhost,O=EC -k ec -z /dev/null -q nistp256
48+
4249
ADD httpreq.txt /httpreq.txt
4350
ADD run.sh /run.sh
51+
ADD server.sh /server.sh
4452
ENTRYPOINT ["/run.sh"]

_dev/tstclnt/server.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
PATH=/dist/OBJ-PATH/bin:$PATH
3+
set -x
4+
5+
# RSA
6+
selfserv -n rsa-server -p 1443 -d /certdb -V tls1.2:tls1.3 -v -Z &
7+
8+
# ECDSA
9+
selfserv -n ecdsa-server -p 2443 -d /certdb -V tls1.2:tls1.3 -v -Z &
10+
11+
wait

0 commit comments

Comments
 (0)