File tree 6 files changed +27
-7
lines changed
6 files changed +27
-7
lines changed Original file line number Diff line number Diff line change @@ -125,11 +125,26 @@ test_expect_success "ipfs help output looks good" '
125
125
test_fsh cat help.txt
126
126
'
127
127
128
- # check transport is encrypted
129
- test_expect_success SOCAT " transport should be encrypted ( needs socat )" '
130
- socat - tcp:localhost:$SWARM_PORT,connect-timeout=1 > swarmnc < ../t0060-data/mss-ls &&
128
+ # check transport is encrypted by default and no plaintext is allowed
129
+
130
+ test_expect_success SOCAT " default transport should support encryption (TLS, needs socat )" '
131
+ socat - tcp:localhost:$SWARM_PORT,connect-timeout=1 > swarmnc < ../t0060-data/mss-tls &&
131
132
grep -q "/tls" swarmnc &&
132
- test_must_fail grep -q "/plaintext/1.0.0" swarmnc ||
133
+ test_must_fail grep -q "na" swarmnc ||
134
+ test_fsh cat swarmnc
135
+ '
136
+
137
+ test_expect_success SOCAT " default transport should support encryption (Noise, needs socat )" '
138
+ socat - tcp:localhost:$SWARM_PORT,connect-timeout=1 > swarmnc < ../t0060-data/mss-noise &&
139
+ grep -q "/noise" swarmnc &&
140
+ test_must_fail grep -q "na" swarmnc ||
141
+ test_fsh cat swarmnc
142
+ '
143
+
144
+ test_expect_success SOCAT " default transport should not support plaintext (needs socat )" '
145
+ socat - tcp:localhost:$SWARM_PORT,connect-timeout=1 > swarmnc < ../t0060-data/mss-plaintext &&
146
+ grep -q "na" swarmnc &&
147
+ test_must_fail grep -q "/plaintext" swarmnc ||
133
148
test_fsh cat swarmnc
134
149
'
135
150
Original file line number Diff line number Diff line change 1
1
/multistream/1.0.0
2
- ls
2
+ /noise
Original file line number Diff line number Diff line change
1
+ /multistream/1.0.0
2
+ /plaintext/2.0.0
Original file line number Diff line number Diff line change
1
+ /multistream/1.0.0
2
+ /tls/1.0.0
Original file line number Diff line number Diff line change @@ -18,8 +18,9 @@ apiaddr=$API_ADDR
18
18
19
19
# Odd. this fails here, but the inverse works on t0060-daemon.
20
20
test_expect_success SOCAT ' transport should be unencrypted ( needs socat )' '
21
- socat - tcp:localhost:$SWARM_PORT,connect-timeout=1 > swarmnc < ../t0060-data/mss-ls &&
22
- grep -q "/plaintext" swarmnc ||
21
+ socat - tcp:localhost:$SWARM_PORT,connect-timeout=1 > swarmnc < ../t0060-data/mss-plaintext &&
22
+ grep -q "/plaintext" swarmnc &&
23
+ test_must_fail grep -q "na" swarmnc ||
23
24
test_fsh cat swarmnc
24
25
'
25
26
You can’t perform that action at this time.
0 commit comments