File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 121121 "description" : " Password for the RethinkDB connection." ,
122122 "default" : " "
123123 },
124+ "security-notes.collab.ssl" : {
125+ "type" : " string" ,
126+ "description" : " SSL/TLS certificate file path for the RethinkDB connection (optional)." ,
127+ "default" : " "
128+ },
124129 "security-notes.collab.projectName" : {
125130 "type" : " string" ,
126131 "description" : " Project name used as the RethinkDB table." ,
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ export function activate(context: vscode.ExtensionContext) {
2929 getSetting ( 'collab.password' ) ,
3030 getSetting ( 'collab.database' ) ,
3131 getSetting ( 'collab.projectName' ) ,
32+ getSetting ( 'collab.ssl' ) ,
3233 noteMap ,
3334 ) ;
3435 } else {
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import * as vscode from 'vscode';
22import * as rethinkdb from 'rethinkdb' ;
33import { Serializer } from '../serialization/serializer' ;
44import { Deserializer } from '../serialization/deserializer' ;
5+ import { readFileSync } from 'fs' ;
56
67export class RemoteDb {
78 private host : string ;
@@ -10,6 +11,7 @@ export class RemoteDb {
1011 private password : string ;
1112 private database : string ;
1213 private table : string ;
14+ private ssl : string ;
1315 private noteMap : Map < string , vscode . CommentThread > ;
1416 private connection : any ;
1517
@@ -20,6 +22,7 @@ export class RemoteDb {
2022 password : string ,
2123 database : string ,
2224 table : string ,
25+ ssl : string ,
2326 noteMap : Map < string , vscode . CommentThread > ,
2427 ) {
2528 this . host = host ;
@@ -28,6 +31,7 @@ export class RemoteDb {
2831 this . password = password ;
2932 this . database = database ;
3033 this . table = table ;
34+ this . ssl = ssl ;
3135 this . noteMap = noteMap ;
3236
3337 this . connect ( ) ;
@@ -41,6 +45,12 @@ export class RemoteDb {
4145 db : this . database ,
4246 user : this . username ,
4347 password : this . password ,
48+ ssl :
49+ this . ssl !== ''
50+ ? {
51+ ca : readFileSync ( this . ssl ) . toString ( ) . trim ( ) ,
52+ }
53+ : undefined ,
4454 } ,
4555 ( err : Error , conn : any ) => {
4656 if ( err ) {
You can’t perform that action at this time.
0 commit comments