1
1
/* eslint-disable no-sync */
2
2
import * as util from 'util' ;
3
3
import { CompletionItemKind , CancellationToken , Connection , CompletionItem , MarkupContent , MarkupKind } from 'vscode-languageserver/node' ;
4
- import fs from 'fs' ;
5
4
import path from 'path' ;
6
5
import { signatures } from '@mongosh/shell-api' ;
7
6
import translator from '@mongosh/i18n' ;
@@ -46,45 +45,6 @@ export default class MongoDBService {
46
45
return this . _connectionOptions ;
47
46
}
48
47
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
-
88
48
setExtensionPath ( extensionPath : string ) : void {
89
49
if ( ! extensionPath ) {
90
50
this . _connection . console . log ( 'Set extensionPath error: extensionPath is undefined' ) ;
@@ -111,18 +71,6 @@ export default class MongoDBService {
111
71
return Promise . resolve ( false ) ;
112
72
}
113
73
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
-
126
74
try {
127
75
this . _getDatabasesCompletionItems ( ) ;
128
76
0 commit comments