File tree Expand file tree Collapse file tree
test/integration/connection-pool Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ matrix:
1414 PGSSLROOTCERT=$TRAVIS_BUILD_DIR/packages/pg/test/tls/test-server-ca.crt
1515 PGSSLCERT=$TRAVIS_BUILD_DIR/packages/pg/test/tls/test-client.crt
1616 PGSSLKEY=$TRAVIS_BUILD_DIR/packages/pg/test/tls/test-client.key
17+ PG_CLIENT_CERT_TEST=1
1718 before_script :
1819 - |
1920 cat <<'travis ci breaks heredoc' | sudo tee -a /etc/postgresql/10/main/postgresql.conf
@@ -26,6 +27,6 @@ matrix:
2627 - sudo make -C packages/pg/test/tls install DESTDIR=/etc/postgresql/10/main
2728 - sudo systemctl restart postgresql
2829 - yarn build
29- - node packages/pg/script/create-test-tables.js postgresql:///
3030 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) {
5656 }
5757}
5858
59- console . log ( '%O' , config . ssl )
60-
6159var con = new pg . Client ( config )
6260
6361con . 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