@@ -104,9 +104,17 @@ function storeFingerprint( serverId, knownHostsPath, fingerprint, cb ) {
104104}
105105
106106const 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 ) {
108116 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 " +
110118 "to verify trust for encrypted connections, but have not configured any " +
111119 "trustedCertificates. You must specify the path to at least one trusted " +
112120 "X.509 certificate for this to work. Two other alternatives is to use " +
@@ -153,7 +161,7 @@ const TrustStrategy = {
153161 // do TOFU, and the safe approach is to fail.
154162 onFailure ( newError ( "You are using a version of NodeJS that does not " +
155163 "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 " +
157165 "config instead, or disable encryption using `encrypted:false`." ) ) ;
158166 return ;
159167 }
@@ -201,7 +209,7 @@ function connect( opts, onSuccess, onFailure=(()=>null) ) {
201209 return TrustStrategy [ opts . trust ] ( opts , onSuccess , onFailure ) ;
202210 } else {
203211 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 " +
205213 "configuration. Alternatively, you can disable encryption by setting " +
206214 "`encrypted:false`. There is no mechanism to use encryption without trust verification, " +
207215 "because this incurs the overhead of encryption without improving security. If " +
0 commit comments