Skip to content

Commit b71ca61

Browse files
authored
fix(language-server): remove loading ssl/tls files to just passing file names VSCODE-292 (#347)
1 parent 55a5fa2 commit b71ca61

File tree

1 file changed

+0
-52
lines changed

1 file changed

+0
-52
lines changed

src/language/mongoDBService.ts

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* eslint-disable no-sync */
22
import * as util from 'util';
33
import { CompletionItemKind, CancellationToken, Connection, CompletionItem, MarkupContent, MarkupKind } from 'vscode-languageserver/node';
4-
import fs from 'fs';
54
import path from 'path';
65
import { signatures } from '@mongosh/shell-api';
76
import translator from '@mongosh/i18n';
@@ -46,45 +45,6 @@ export default class MongoDBService {
4645
return this._connectionOptions;
4746
}
4847

49-
_isSslConnection(connectionOptions: ConnectionOptions): boolean {
50-
return !!(
51-
connectionOptions &&
52-
(connectionOptions.sslCA ||
53-
connectionOptions.sslCert ||
54-
connectionOptions.sslPass)
55-
);
56-
}
57-
58-
_readSslFileSync(sslOption: string | string[]): string | undefined {
59-
if (Array.isArray(sslOption)) {
60-
sslOption = sslOption[0];
61-
}
62-
63-
if (typeof sslOption === 'string') {
64-
return fs.readFileSync(sslOption).toString();
65-
}
66-
}
67-
68-
_loadSslBinaries(): void {
69-
if (this._connectionOptions?.sslCA) {
70-
this._connectionOptions.sslCA = this._readSslFileSync(
71-
this._connectionOptions.sslCA
72-
);
73-
}
74-
75-
if (this._connectionOptions?.sslKey) {
76-
this._connectionOptions.sslKey = this._readSslFileSync(
77-
this._connectionOptions.sslKey
78-
);
79-
}
80-
81-
if (this._connectionOptions?.sslCert) {
82-
this._connectionOptions.sslCert = this._readSslFileSync(
83-
this._connectionOptions.sslCert
84-
);
85-
}
86-
}
87-
8848
setExtensionPath(extensionPath: string): void {
8949
if (!extensionPath) {
9050
this._connection.console.log('Set extensionPath error: extensionPath is undefined');
@@ -111,18 +71,6 @@ export default class MongoDBService {
11171
return Promise.resolve(false);
11272
}
11373

114-
if (this._isSslConnection(this._connectionOptions)) {
115-
try {
116-
this._loadSslBinaries();
117-
} catch (error) {
118-
this._connection.console.log(
119-
`SSL FILES read error: ${util.inspect(error)}`
120-
);
121-
122-
return Promise.resolve(false);
123-
}
124-
}
125-
12674
try {
12775
this._getDatabasesCompletionItems();
12876

0 commit comments

Comments
 (0)