@@ -104,9 +104,17 @@ function storeFingerprint( serverId, knownHostsPath, fingerprint, cb ) {
104
104
}
105
105
106
106
const TrustStrategy = {
107
- TRUST_SIGNED_CERTIFICATES : function ( opts , onSuccess , onFailure ) {
107
+ /**
108
+ * @deprecated Since version 1.0. Will be deleted in a future version. TRUST_CUSTOM_CA_SIGNED_CERTIFICATES.
109
+ */
110
+ TRUST_SIGNED_CERTIFICATES : function ( opts , onSuccess , onFailure ) {
111
+ console . log ( "`TRUST_SIGNED_CERTIFICATES` has been deprecated as option and will be removed in a future version of " +
112
+ "the driver. Pleas use `TRUST_CUSTOM_CA_SIGNED_CERTIFICATES` instead." ) ;
113
+ return TrustStrategy . TRUST_CUSTOM_CA_SIGNED_CERTIFICATES ( opts , onSuccess , onFailure ) ;
114
+ } ,
115
+ TRUST_CUSTOM_CA_SIGNED_CERTIFICATES : function ( opts , onSuccess , onFailure ) {
108
116
if ( ! opts . trustedCertificates || opts . trustedCertificates . length == 0 ) {
109
- onFailure ( newError ( "You are using TRUST_SIGNED_CERTIFICATES as the method " +
117
+ onFailure ( newError ( "You are using TRUST_CUSTOM_CA_SIGNED_CERTIFICATES as the method " +
110
118
"to verify trust for encrypted connections, but have not configured any " +
111
119
"trustedCertificates. You must specify the path to at least one trusted " +
112
120
"X.509 certificate for this to work. Two other alternatives is to use " +
@@ -153,7 +161,7 @@ const TrustStrategy = {
153
161
// do TOFU, and the safe approach is to fail.
154
162
onFailure ( newError ( "You are using a version of NodeJS that does not " +
155
163
"support trust-on-first use encryption. You can either upgrade NodeJS to " +
156
- "a newer version, use `trust:TRUST_SIGNED_CERTIFICATES ` in your driver " +
164
+ "a newer version, use `trust:TRUST_CUSTOM_CA_SIGNED_CERTIFICATES ` in your driver " +
157
165
"config instead, or disable encryption using `encrypted:false`." ) ) ;
158
166
return ;
159
167
}
@@ -201,7 +209,7 @@ function connect( opts, onSuccess, onFailure=(()=>null) ) {
201
209
return TrustStrategy [ opts . trust ] ( opts , onSuccess , onFailure ) ;
202
210
} else {
203
211
onFailure ( newError ( "Unknown trust strategy: " + opts . trust + ". Please use either " +
204
- "trust:'TRUST_SIGNED_CERTIFICATES ' or trust:'TRUST_ON_FIRST_USE' in your driver " +
212
+ "trust:'TRUST_CUSTOM_CA_SIGNED_CERTIFICATES ' or trust:'TRUST_ON_FIRST_USE' in your driver " +
205
213
"configuration. Alternatively, you can disable encryption by setting " +
206
214
"`encrypted:false`. There is no mechanism to use encryption without trust verification, " +
207
215
"because this incurs the overhead of encryption without improving security. If " +
0 commit comments