Skip to content

Commit df687b6

Browse files
socks5 fixed?
1 parent ba138da commit df687b6

File tree

5 files changed

+50
-38
lines changed

5 files changed

+50
-38
lines changed

.evergreen/config.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,11 +1862,12 @@ tasks:
18621862
updates:
18631863
- {key: VERSION, value: latest}
18641864
- {key: TOPOLOGY, value: replica_set}
1865+
- {key: AUTH, value: noauth}
18651866
- func: install dependencies
18661867
- func: bootstrap mongo-orchestration
18671868
- func: bootstrap kms servers
18681869
- func: run socks5 tests
1869-
- name: test-socks5-csfle-auth
1870+
- name: test-socks5-csfle-proxy-auth
18701871
tags:
18711872
- socks5-csfle
18721873
commands:
@@ -1877,14 +1878,15 @@ tasks:
18771878
- {key: VERSION, value: latest}
18781879
- {key: TOPOLOGY, value: replica_set}
18791880
- {key: TEST_SOCKS5_CSFLE, value: 'true'}
1880-
- {key: AUTH, value: auth}
1881+
- {key: AUTH, value: noauth}
1882+
- {key: PROXY_AUTH, value: 'true'}
18811883
- {key: CLIENT_ENCRYPTION, value: 'true'}
18821884
- {key: TEST_CSFLE, value: 'true'}
18831885
- func: install dependencies
18841886
- func: bootstrap mongo-orchestration
18851887
- func: bootstrap kms servers
18861888
- func: run socks5 tests
1887-
- name: test-socks5-csfle-noauth
1889+
- name: test-socks5-csfle-no-proxy-auth
18881890
tags:
18891891
- socks5-csfle
18901892
commands:
@@ -1912,6 +1914,7 @@ tasks:
19121914
- {key: SSL, value: ssl}
19131915
- {key: VERSION, value: latest}
19141916
- {key: TOPOLOGY, value: replica_set}
1917+
- {key: AUTH, value: noauth}
19151918
- func: install dependencies
19161919
- func: bootstrap mongo-orchestration
19171920
- func: run socks5 tests
@@ -4670,8 +4673,8 @@ buildvariants:
46704673
- test-auth-kerberos
46714674
- test-auth-ldap
46724675
- test-socks5
4673-
- test-socks5-csfle-auth
4674-
- test-socks5-csfle-noauth
4676+
- test-socks5-csfle-proxy-auth
4677+
- test-socks5-csfle-no-proxy-auth
46754678
- test-socks5-tls
46764679
- test-snappy-compression
46774680
- test-zstd-1.x-compression
@@ -4731,8 +4734,8 @@ buildvariants:
47314734
- test-auth-kerberos
47324735
- test-auth-ldap
47334736
- test-socks5
4734-
- test-socks5-csfle-auth
4735-
- test-socks5-csfle-noauth
4737+
- test-socks5-csfle-proxy-auth
4738+
- test-socks5-csfle-no-proxy-auth
47364739
- test-socks5-tls
47374740
- test-snappy-compression
47384741
- test-zstd-1.x-compression
@@ -4792,8 +4795,8 @@ buildvariants:
47924795
- test-auth-kerberos
47934796
- test-auth-ldap
47944797
- test-socks5
4795-
- test-socks5-csfle-auth
4796-
- test-socks5-csfle-noauth
4798+
- test-socks5-csfle-proxy-auth
4799+
- test-socks5-csfle-no-proxy-auth
47974800
- test-socks5-tls
47984801
- test-snappy-compression
47994802
- test-zstd-1.x-compression
@@ -4853,8 +4856,8 @@ buildvariants:
48534856
- test-auth-kerberos
48544857
- test-auth-ldap
48554858
- test-socks5
4856-
- test-socks5-csfle-auth
4857-
- test-socks5-csfle-noauth
4859+
- test-socks5-csfle-proxy-auth
4860+
- test-socks5-csfle-no-proxy-auth
48584861
- test-socks5-tls
48594862
- test-snappy-compression
48604863
- test-zstd-1.x-compression
@@ -4911,8 +4914,8 @@ buildvariants:
49114914
- test-latest-load-balanced
49124915
- test-auth-kerberos
49134916
- test-auth-ldap
4914-
- test-socks5-csfle-auth
4915-
- test-socks5-csfle-noauth
4917+
- test-socks5-csfle-proxy-auth
4918+
- test-socks5-csfle-no-proxy-auth
49164919
- test-socks5-tls
49174920
- test-snappy-compression
49184921
- test-zstd-1.x-compression

.evergreen/generate_evergreen_tasks.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ TASKS.push(
175175
commands: [
176176
updateExpansions({
177177
VERSION: 'latest',
178-
TOPOLOGY: 'replica_set'
178+
TOPOLOGY: 'replica_set',
179+
AUTH: 'noauth',
179180
}),
180181
{ func: 'install dependencies' },
181182
{ func: 'bootstrap mongo-orchestration' },
@@ -184,14 +185,15 @@ TASKS.push(
184185
]
185186
},
186187
{
187-
name: 'test-socks5-csfle-auth',
188+
name: 'test-socks5-csfle-proxy-auth',
188189
tags: ['socks5-csfle'],
189190
commands: [
190191
updateExpansions({
191192
VERSION: 'latest',
192193
TOPOLOGY: 'replica_set',
193194
TEST_SOCKS5_CSFLE: 'true',
194-
AUTH: 'auth',
195+
AUTH: 'noauth',
196+
PROXY_AUTH: 'true',
195197
CLIENT_ENCRYPTION: 'true',
196198
TEST_CSFLE: 'true'
197199
}),
@@ -202,7 +204,7 @@ TASKS.push(
202204
]
203205
},
204206
{
205-
name: 'test-socks5-csfle-noauth',
207+
name: 'test-socks5-csfle-no-proxy-auth',
206208
tags: ['socks5-csfle'],
207209
commands: [
208210
updateExpansions({
@@ -226,7 +228,8 @@ TASKS.push(
226228
updateExpansions({
227229
SSL: 'ssl',
228230
VERSION: 'latest',
229-
TOPOLOGY: 'replica_set'
231+
TOPOLOGY: 'replica_set',
232+
AUTH: 'noauth'
230233
}),
231234
{ func: 'install dependencies' },
232235
{ func: 'bootstrap mongo-orchestration' },

.evergreen/run-socks5-tests.sh

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ PYTHON_BINARY=$(bash -c ". $DRIVERS_TOOLS/.evergreen/find-python3.sh && ensure_p
2222

2323
# ssl setup
2424
SSL=${SSL:-nossl}
25+
PROXY_AUTH=${PROXY_AUTH:-false}
26+
2527
if [ "$SSL" != "nossl" ]; then
2628
export SSL_KEY_FILE="$DRIVERS_TOOLS/.evergreen/x509gen/client.pem"
2729
export SSL_CA_FILE="$DRIVERS_TOOLS/.evergreen/x509gen/ca.pem"
@@ -39,33 +41,37 @@ if [ "Windows_NT" = "$OS" ]; then
3941
SOCKS5_SERVER_SCRIPT=$(cygpath -w "$SOCKS5_SERVER_SCRIPT")
4042
fi
4143

42-
if [ "$AUTH" = "auth" ]; then
43-
# First, test with Socks5 + authentication required
44+
if [ "$PROXY_AUTH" = "true" ]; then
45+
# Test with Socks5 + proxy authentication required
4446
"$PYTHON_BINARY" "$SOCKS5_SERVER_SCRIPT" --port 1080 --auth username:p4ssw0rd --map "127.0.0.1:12345 to $FIRST_HOST" &
4547
SOCKS5_PROXY_PID=$!
4648
if [[ $TEST_SOCKS5_CSFLE == "true" ]]; then
4749
setup_fle
48-
[ "$SSL" == "nossl" ] && [[ "$OSTYPE" == "linux-gnu"* ]] && \
49-
env MONGODB_URI='mongodb://127.0.0.1:12345/?proxyHost=127.0.0.1&proxyUsername=username&proxyPassword=p4ssw0rd' \
50-
npm run check:csfle
50+
# [ "$SSL" != "ssl" ] && [[ "$OSTYPE" == "linux-gnu"* ]] && \
51+
env MONGODB_URI='mongodb://127.0.0.1:12345/?proxyHost=127.0.0.1&proxyUsername=username&proxyPassword=p4ssw0rd' npm run check:csfle
52+
echo "Running"
53+
5154
else
5255
env SOCKS5_CONFIG='["127.0.0.1",1080,"username","p4ssw0rd"]' npm run check:socks5
5356
fi
5457
kill $SOCKS5_PROXY_PID
55-
else
56-
# Second, test with Socks5 + no authentication
57-
"$PYTHON_BINARY" "$SOCKS5_SERVER_SCRIPT" --port 1081 --map "127.0.0.1:12345 to $FIRST_HOST" &
58-
SOCKS5_PROXY_PID=$!
59-
if [[ $TEST_SOCKS5_CSFLE == "true" ]]; then
60-
setup_fle
61-
[ "$SSL" == "nossl" ] && [[ "$OSTYPE" == "linux-gnu"* ]] && \
62-
env MONGODB_URI='mongodb://127.0.0.1:12345/?proxyHost=127.0.0.1&proxyPort=1081' \
63-
npm run check:csfle
64-
else
65-
env SOCKS5_CONFIG='["127.0.0.1",1081]' npm run check:socks5
66-
fi
67-
kill $SOCKS5_PROXY_PID
58+
59+
exit 0
60+
fi
61+
62+
63+
# Test with Socks5 + no proxy authentication
64+
"$PYTHON_BINARY" "$SOCKS5_SERVER_SCRIPT" --port 1081 --map "127.0.0.1:12345 to $FIRST_HOST" &
65+
SOCKS5_PROXY_PID=$!
66+
if [[ $TEST_SOCKS5_CSFLE == "true" ]]; then
67+
setup_fle
68+
[ "$SSL" != "nossl" ] && [[ "$OSTYPE" == "linux-gnu"* ]] && \
69+
env MONGODB_URI='mongodb://127.0.0.1:12345/?proxyHost=127.0.0.1&proxyPort=1081' \
70+
npm run check:csfle
71+
else
72+
env SOCKS5_CONFIG='["127.0.0.1",1081]' npm run check:socks5
6873
fi
74+
kill $SOCKS5_PROXY_PID
6975

7076
# TODO: It might be worth using something more robust to control
7177
# the Socks5 proxy server script's lifetime

.evergreen/setup-fle.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ rm -f ./prepare_client_encryption.sh
77

88
if [ -z "${RUN_WITH_MONGOCRYPTD}" ]; then
99
# Set up crypt shared lib if we don't want to use mongocryptd
10-
source ${PROJECT_DIRECTORY}/.evergreen/prepare-crypt-shared-lib.sh
10+
source .evergreen/prepare-crypt-shared-lib.sh
1111
echo "CRYPT_SHARED_LIB_PATH: $CRYPT_SHARED_LIB_PATH"
1212
else
1313
echo "CRYPT_SHARED_LIB_PATH not set; using mongocryptd"

test/csfle-kms-providers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// "privateKey": process.env.FLE_GCP_PRIVATEKEY
1717
// },
1818
// "local": {
19-
// "key": Buffer.from("Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk", 'base64')
19+
// "key": "Mng0NCt4ZHVUYUJCa1kxNkVyNUR1QURhZ2h2UzR2d2RrZzh0cFBwM3R6NmdWMDFBMUN3YkQ5aXRRMkhGRGdQV09wOGVNYUMxT2k3NjZKelhaQmRCZGJkTXVyZG9uSjFk"
2020
// },
2121
// "kmip": {
2222
// "endpoint": "localhost:5698"

0 commit comments

Comments
 (0)