File tree 3 files changed +26
-4
lines changed
test/integration/connection-pool
3 files changed +26
-4
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ matrix:
14
14
PGSSLROOTCERT=$TRAVIS_BUILD_DIR/packages/pg/test/tls/test-server-ca.crt
15
15
PGSSLCERT=$TRAVIS_BUILD_DIR/packages/pg/test/tls/test-client.crt
16
16
PGSSLKEY=$TRAVIS_BUILD_DIR/packages/pg/test/tls/test-client.key
17
+ PG_CLIENT_CERT_TEST=1
17
18
before_script :
18
19
- |
19
20
cat <<'travis ci breaks heredoc' | sudo tee -a /etc/postgresql/10/main/postgresql.conf
@@ -26,6 +27,6 @@ matrix:
26
27
- sudo make -C packages/pg/test/tls install DESTDIR=/etc/postgresql/10/main
27
28
- sudo systemctl restart postgresql
28
29
- yarn build
29
- - node packages/pg/script/create-test-tables.js postgresql:///
30
30
script : |
31
- yarn lerna exec --scope pg yarn test
31
+ node packages/pg/test/integration/connection-pool/test-tls.js
32
+ node packages/pg/test/integration/connection-pool/test-tls.js native
Original file line number Diff line number Diff line change @@ -56,8 +56,6 @@ if (process.env.PGSSLMODE) {
56
56
}
57
57
}
58
58
59
- console . log ( '%O' , config . ssl )
60
-
61
59
var con = new pg . Client ( config )
62
60
63
61
con . connect ( ( err ) => {
Original file line number Diff line number Diff line change
1
+ 'use strict'
2
+
3
+ const fs = require ( 'fs' )
4
+
5
+ const helper = require ( './test-helper' )
6
+ const pg = helper . pg
7
+
8
+ const suite = new helper . Suite ( )
9
+
10
+ if ( process . env . PG_CLIENT_CERT_TEST ) {
11
+ suite . testAsync ( 'client certificate' , async ( ) => {
12
+ const pool = new pg . Pool ( {
13
+ ssl : {
14
+ ca : fs . readFileSync ( process . env . PGSSLROOTCERT ) ,
15
+ cert : fs . readFileSync ( process . env . PGSSLCERT ) ,
16
+ key : fs . readFileSync ( process . env . PGSSLKEY ) ,
17
+ } ,
18
+ } )
19
+
20
+ await pool . query ( 'SELECT 1' )
21
+ await pool . end ( )
22
+ } )
23
+ }
You can’t perform that action at this time.
0 commit comments